public function __destruct() { //XXX 此处假定除factory不会有其他地方new API_Redis if ($this->masterClient) { $this->masterClient->close(); } if ($this->slaveClient) { $this->slaveClient->close(); } if ($this->masterBackClient) { $this->masterBackClient->close(); } if ($this->slaveBackClient) { $this->slaveBackClient->close(); } }