Moved the default server profile class name to a private static variable of the Client class.

This commit is contained in:
Daniele Alessandri
2009-12-18 21:59:00 +01:00
parent 88cda9e52c
commit 6e76fbf660
+3 -2
View File
@@ -12,11 +12,12 @@ class Client {
// TODO: command arguments should be sanitized or checked for bad arguments
// (e.g. CRLF in keys for inline commands)
private static $_defaultServerProfile = 'Predis\RedisServer__V1_2';
private $_connection, $_serverProfile;
public function __construct($host = Connection::DEFAULT_HOST, $port = Connection::DEFAULT_PORT) {
// TODO: for now the server compatibility profile is hardcoded.
$this->_serverProfile = new RedisServer__V1_2();
// TODO: the server profile should be provided upon initialization.
$this->_serverProfile = new self::$_defaultServerProfile();
$this->setConnection($this->createConnection(
func_num_args() === 1 && is_array($host) || @stripos('redis://') === 0
? $host