Przeglądaj źródła

Make multiple explicit calls to Predis\Client::connect() possible.

Daniele Alessandri 14 lat temu
rodzic
commit
b3e7cfe408
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      lib/Predis.php

+ 3 - 1
lib/Predis.php

@@ -123,7 +123,9 @@ class Client {
     }
 
     public function connect() {
-        $this->_connection->connect();
+        if (!$this->_connection->isConnected()) {
+            $this->_connection->connect();
+        }
     }
 
     public function disconnect() {