public function __destruct() { if ($this->conn) { phpiredis_disconnect($this->conn); } }
/** * @param bool $force */ public function disconnect($force = false) { // connection may not have been successful, yet somebody may still call disconnect(), // so here's a little check for that if ($this->connection) { phpiredis_disconnect($this->connection, $force); } $this->connection = null; }