mirror of
https://github.com/predis/predis.git
synced 2026-09-04 23:08:00 +00:00
Made the constructor method of Predis\Client more flexible with the passed arguments.
This commit is contained in:
+6
-2
@@ -17,9 +17,13 @@ class Client {
|
||||
|
||||
public function __construct($host = Connection::DEFAULT_HOST, $port = Connection::DEFAULT_PORT) {
|
||||
$this->_pipelining = false;
|
||||
$connectionParams = new ConnectionParameters(array('host' => $host, 'port' => $port));
|
||||
$this->_connection = new Connection($connectionParams);
|
||||
$this->_registeredCommands = self::initializeDefaultCommands();
|
||||
|
||||
$this->setConnection($this->createConnection(
|
||||
func_num_args() === 1 && is_array($host) || @stripos('redis://') === 0
|
||||
? $host
|
||||
: array('host' => $host, 'port' => $port)
|
||||
));
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
|
||||
Reference in New Issue
Block a user