浏览代码

Move command "COMMAND" to the server profile for Redis 2.8.

This command has been backported from the "unstable" branch of Redis
to the "2.8" one, and it is available since 2.8.13.
Daniele Alessandri 11 年之前
父节点
当前提交
cab266f359

+ 1 - 1
CHANGELOG.md

@@ -4,7 +4,7 @@ v0.8.7 (2014-xx-xx)
 - Added `3.0` in the server profiles aliases list for Redis 3.0. `2.8` is still
   the default server profile and `dev` still targets Redis 3.0.
 
-- Added `COMMAND` to the server profile for Redis 3.0.
+- Added `COMMAND` to the server profile for Redis 2.8.
 
 - Switched internally to the `CLUSTER SLOTS` command instead of `CLUSTER NODES`
   to fetch the updated slots map from redis-cluster. This change requires users

+ 3 - 0
lib/Predis/Profile/ServerVersion28.php

@@ -250,6 +250,9 @@ class ServerVersion28 extends ServerProfile
             'pfadd'                     => 'Predis\Command\HyperLogLogAdd',
             'pfcount'                   => 'Predis\Command\HyperLogLogCount',
             'pfmerge'                   => 'Predis\Command\HyperLogLogMerge',
+
+            /* remote server control commands */
+            'command'                   => 'Predis\Command\ServerCommand',
         );
     }
 }

+ 3 - 2
lib/Predis/Profile/ServerVersion30.php

@@ -251,10 +251,11 @@ class ServerVersion30 extends ServerProfile
             'pfcount'                   => 'Predis\Command\HyperLogLogCount',
             'pfmerge'                   => 'Predis\Command\HyperLogLogMerge',
 
-            /* ---------------- Redis 3.0 ---------------- */
-
             /* remote server control commands */
             'command'                   => 'Predis\Command\ServerCommand',
+
+            /* ---------------- Redis 3.0 ---------------- */
+
         );
     }
 }

+ 3 - 0
tests/Predis/Command/ServerCommandTest.php

@@ -82,6 +82,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsEmptyCommandInfoOnNonExistingCommand()
     {
@@ -93,6 +94,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsCommandInfoOnExistingCommand()
     {
@@ -105,6 +107,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsListOfCommandInfoWithNoArguments()
     {

+ 1 - 0
tests/Predis/Profile/ServerVersion28Test.php

@@ -183,6 +183,7 @@ class ServerVersion28Test extends PredisProfileTestCase
             142 => 'pfadd',
             143 => 'pfcount',
             144 => 'pfmerge',
+            145 => 'command',
         );
     }
 }