mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Remove almost useless method.
This commit is contained in:
@@ -30,16 +30,14 @@ abstract class AbstractConnection implements SingleConnectionInterface
|
||||
private $cachedId;
|
||||
|
||||
protected $parameters;
|
||||
protected $initCmds;
|
||||
protected $initCmds = array();
|
||||
|
||||
/**
|
||||
* @param ConnectionParametersInterface $parameters Parameters used to initialize the connection.
|
||||
*/
|
||||
public function __construct(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->initCmds = array();
|
||||
$this->parameters = $this->checkParameters($parameters);
|
||||
$this->initializeProtocol($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,17 +70,6 @@ abstract class AbstractConnection implements SingleConnectionInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes some common configurations of the underlying protocol processor
|
||||
* from the connection parameters.
|
||||
*
|
||||
* @param ConnectionParametersInterface $parameters Parameters used to initialize the connection.
|
||||
*/
|
||||
protected function initializeProtocol(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the underlying resource used to communicate with Redis.
|
||||
*
|
||||
|
||||
@@ -32,17 +32,11 @@ class ComposableStreamConnection extends StreamConnection implements ComposableC
|
||||
*/
|
||||
public function __construct(ConnectionParametersInterface $parameters, ProtocolInterface $protocol = null)
|
||||
{
|
||||
$this->setProtocol($protocol ?: new TextProtocol());
|
||||
$protocol = $protocol ?: new TextProtocol();
|
||||
$protocol->setOption('iterable_multibulk', $parameters->iterable_multibulk);
|
||||
|
||||
parent::__construct($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeProtocol(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->protocol->setOption('iterable_multibulk', $parameters->iterable_multibulk);
|
||||
$this->protocol = $protocol;
|
||||
$this->parameters = $this->checkParameters($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,6 +57,7 @@ class PhpiredisConnection extends AbstractConnection
|
||||
public function __construct(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->checkExtensions();
|
||||
$this->initializeReader();
|
||||
|
||||
parent::__construct($parameters);
|
||||
}
|
||||
@@ -113,14 +114,6 @@ class PhpiredisConnection extends AbstractConnection
|
||||
$this->reader = $reader;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeProtocol(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->initializeReader();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the handler used by the protocol reader to handle status replies.
|
||||
*
|
||||
@@ -392,6 +385,7 @@ class PhpiredisConnection extends AbstractConnection
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
$this->initializeProtocol($this->getParameters());
|
||||
$this->checkExtensions();
|
||||
$this->initializeReader();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,16 @@ class StreamConnection extends AbstractConnection
|
||||
{
|
||||
private $mbiterable;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->mbiterable = (bool) $parameters->iterable_multibulk;
|
||||
|
||||
parent::__construct($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects from the server and destroys the underlying resource when
|
||||
* PHP's garbage collector kicks in only if the connection has not been
|
||||
@@ -49,14 +59,6 @@ class StreamConnection extends AbstractConnection
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeProtocol(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->mbiterable = (bool) $parameters->iterable_multibulk;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
||||
@@ -57,13 +57,13 @@ class WebdisConnection implements SingleConnectionInterface
|
||||
*/
|
||||
public function __construct(ConnectionParametersInterface $parameters)
|
||||
{
|
||||
$this->parameters = $parameters;
|
||||
$this->checkExtensions();
|
||||
|
||||
if ($parameters->scheme !== 'http') {
|
||||
throw new \InvalidArgumentException("Invalid scheme: {$parameters->scheme}");
|
||||
}
|
||||
|
||||
$this->checkExtensions();
|
||||
$this->parameters = $parameters;
|
||||
$this->resource = $this->initializeCurl($parameters);
|
||||
$this->reader = $this->initializeReader($parameters);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user