瀏覽代碼

Changed the way arguments of SLAVEOF are prepared before serialization to be compatible with an eventual switch to multi-bulk requests.

Daniele Alessandri 15 年之前
父節點
當前提交
81aef81b55
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      lib/Predis.php

+ 4 - 1
lib/Predis.php

@@ -2283,7 +2283,10 @@ class SlaveOf extends \Predis\InlineCommand {
     public function canBeHashed()  { return false; }
     public function getCommandId() { return 'SLAVEOF'; }
     public function filterArguments(Array $arguments) {
-        return count($arguments) === 0 ? array('NO ONE') : $arguments;
+        if (count($arguments) === 0 || $arguments[0] === 'NO ONE') {
+            return array('NO', 'ONE');
+        }
+        return $arguments;
     }
 }