瀏覽代碼

Pass the client options to the internal cluster initializer method.

This change is useless right now, but when Predis will support Redis cluster
we will need to have access the connection factory object since it will be
required by our future RedisCluster class.
Daniele Alessandri 13 年之前
父節點
當前提交
dd20e8557f
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lib/Predis/Options/ClientCluster.php

+ 4 - 3
lib/Predis/Options/ClientCluster.php

@@ -46,7 +46,7 @@ class ClientCluster extends Option
         if (is_callable($value)) {
             return $this->checkInstance(call_user_func($value));
         }
-        $initializer = $this->getInitializer($value);
+        $initializer = $this->getInitializer($options, $value);
 
         return $this->checkInstance($initializer());
     }
@@ -54,10 +54,11 @@ class ClientCluster extends Option
     /**
      * Returns an initializer for the specified FQN or type.
      *
-     * @param string $fqnOrType Type of cluster of FQN of a class implementing IConnectionCluster
+     * @param string $fqnOrType Type of cluster of FQN of a class implementing IConnectionCluster.
+     * @param IClientOptions $options Instance of the client options.
      * @return \Closure
      */
-    protected function getInitializer($fqnOrType)
+    protected function getInitializer(IClientOptions $options, $fqnOrType)
     {
         switch ($fqnOrType) {
             case 'predis':