瀏覽代碼

Add the ability to set a different protocol processor on connection instances.

Daniele Alessandri 14 年之前
父節點
當前提交
2853ba7cef
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lib/Predis.php

+ 5 - 0
lib/Predis.php

@@ -1158,6 +1158,7 @@ interface IConnection {
 interface IConnectionSingle extends IConnection {
     public function getParameters();
     public function getProtocol();
+    public function setProtocol(IRedisProtocol $protocol);
     public function __toString();
     public function writeBytes($buffer);
     public function readBytes($length);
@@ -1237,6 +1238,10 @@ abstract class ConnectionBase implements IConnectionSingle {
         return $this->_protocol;
     }
 
+    public function setProtocol(IRedisProtocol $protocol) {
+        $this->_protocol = $protocol;
+    }
+
     public function __toString() {
         if (!isset($this->_cachedId)) {
             $this->_cachedId = "{$this->_params->host}:{$this->_params->port}";