mirror of
https://github.com/predis/predis.git
synced 2026-08-30 20:21:31 +00:00
@@ -185,8 +185,8 @@ class Client {
|
||||
$connection = $this->_connection;
|
||||
$pipeline = new PipelineContext($this,
|
||||
Helpers::isCluster($connection)
|
||||
? new Pipeline\SafeClusterExecutor($connection)
|
||||
: new Pipeline\SafeExecutor($connection)
|
||||
? new Pipeline\SafeClusterExecutor()
|
||||
: new Pipeline\SafeExecutor()
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -6,13 +6,14 @@ use Predis\Helpers;
|
||||
use Predis\ClientException;
|
||||
use Predis\Commands\ICommand;
|
||||
use Predis\Distribution\IDistributionStrategy;
|
||||
use Predis\Distribution\HashRing;
|
||||
|
||||
class ConnectionCluster implements IConnectionCluster, \IteratorAggregate {
|
||||
private $_pool, $_distributor;
|
||||
|
||||
public function __construct(IDistributionStrategy $distributor = null) {
|
||||
$this->_pool = array();
|
||||
$this->_distributor = $distributor ?: new Distribution\HashRing();
|
||||
$this->_distributor = $distributor ?: new HashRing();
|
||||
}
|
||||
|
||||
public function isConnected() {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Predis\Protocols\Text;
|
||||
|
||||
use Predis\Helpers;
|
||||
use Predis\ProtocolException;
|
||||
use Predis\Protocols\IResponseHandler;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Predis\Protocols\Text;
|
||||
|
||||
use Predis\Helpers;
|
||||
use Predis\ProtocolException;
|
||||
use Predis\Protocols\IResponseHandler;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class TextResponseReader implements IResponseReader {
|
||||
|
||||
$prefix = $header[0];
|
||||
if (!isset($this->_prefixHandlers[$prefix])) {
|
||||
$this->throwMalformedResponse($connection, "Unknown prefix '$prefix'");
|
||||
$this->protocolError($connection, "Unknown prefix '$prefix'");
|
||||
}
|
||||
$handler = $this->_prefixHandlers[$prefix];
|
||||
return $handler->handle($connection, substr($header, 1));
|
||||
|
||||
Reference in New Issue
Block a user