mirror of
https://github.com/predis/predis.git
synced 2026-09-01 05:03:28 +00:00
Prepare to return the appropriate instance of Predis\IConnectionSingle based on the URI scheme.
This commit is contained in:
+6
-1
@@ -113,7 +113,7 @@ class Client {
|
||||
|
||||
private function createConnection($parameters) {
|
||||
$params = new ConnectionParameters($parameters);
|
||||
$connection = new TcpConnection($params, $this->_responseReader);
|
||||
$connection = $this->createConnectionInstance($params);
|
||||
|
||||
if ($params->password !== null) {
|
||||
$connection->pushInitCommand($this->createCommand(
|
||||
@@ -129,6 +129,11 @@ class Client {
|
||||
return $connection;
|
||||
}
|
||||
|
||||
private function createConnectionInstance(ConnectionParameters $parameters) {
|
||||
// TODO: check scheme and return the appropriate IConnectionSingle instance
|
||||
return new TcpConnection($parameters, $this->_responseReader);
|
||||
}
|
||||
|
||||
private function setConnection(IConnection $connection) {
|
||||
$this->_connection = $connection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user