Эх сурвалжийг харах

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

Daniele Alessandri 14 жил өмнө
parent
commit
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}";