浏览代码

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

Daniele Alessandri 14 年之前
父节点
当前提交
b3e7cfe408
共有 1 个文件被更改,包括 3 次插入1 次删除
  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() {