Browse Source

Started hacking a bit on the new MULTI and EXEC commands.

Daniele Alessandri 15 years ago
parent
commit
a13d0e4d72
1 changed files with 20 additions and 0 deletions
  1. 20 0
      lib/Predis.php

+ 20 - 0
lib/Predis.php

@@ -886,6 +886,16 @@ class RedisServer__V1_2 extends RedisServer__V1_0 {
     }
 }
 
+class RedisServer__Futures extends RedisServer__V1_2 {
+    public function getVersion() { return 0; }
+    public function getSupportedCommands() {
+        return array_merge(parent::getSupportedCommands(), array(
+            'multi'     => '\Predis\Commands\Multi',
+            'exec'      => '\Predis\Commands\Exec'
+        ));
+    }
+}
+
 /* ------------------------------------------------------------------------- */
 
 namespace Predis\Utilities;
@@ -1362,4 +1372,14 @@ class SlaveOf extends \Predis\InlineCommand {
         return count($arguments) === 0 ? array('NO ONE') : $arguments;
     }
 }
+
+class Multi extends \Predis\InlineCommand {
+    public function canBeHashed()  { return false; }
+    public function getCommandId() { return 'MULTI'; }
+}
+
+class Exec extends \Predis\InlineCommand {
+    public function canBeHashed()  { return false; }
+    public function getCommandId() { return 'EXEC'; }
+}
 ?>