ソースを参照

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

Daniele Alessandri 15 年 前
コミット
6e76fbf660
1 ファイル変更3 行追加2 行削除
  1. 3 2
      lib/Predis.php

+ 3 - 2
lib/Predis.php

@@ -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