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

This commit is contained in:
Daniele Alessandri
2011-01-09 15:55:55 +01:00
parent 539a4bbdcd
commit 2853ba7cef
+5
View File
@@ -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}";