Sfoglia il codice sorgente

New command: SCRIPT (Redis v2.6-dev).

See http://redis.io/commands/script.
Daniele Alessandri 13 anni fa
parent
commit
4e0709ad3d
3 ha cambiato i file con 45 aggiunte e 1 eliminazioni
  1. 1 1
      TODO
  2. 43 0
      lib/Predis/Commands/ServerScript.php
  3. 1 0
      lib/Predis/Profiles/ServerVersionNext.php

+ 1 - 1
TODO

@@ -13,4 +13,4 @@
 
 * Missing tests for commands:
     PUBLISH, SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, DEBUG, OBJECT,
-    CLIENT, CONFIG GET, CONFIG SET, CONFIG RESETSTAT, SLOWLOG
+    CLIENT, CONFIG GET, CONFIG SET, CONFIG RESETSTAT, SLOWLOG, SCRIPT

+ 43 - 0
lib/Predis/Commands/ServerScript.php

@@ -0,0 +1,43 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Predis\Commands;
+
+/**
+ * @link http://redis.io/commands/script
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class ServerScript extends Command
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getId()
+    {
+        return 'SCRIPT';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function onPrefixKeys(Array $arguments, $prefix)
+    {
+        /* NOOP */
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function canBeHashed()
+    {
+        return false;
+    }
+}

+ 1 - 0
lib/Predis/Profiles/ServerVersionNext.php

@@ -35,6 +35,7 @@ class ServerVersionNext extends ServerVersion24
             'info'                      => '\Predis\Commands\ServerInfoV26x',
             'eval'                      => '\Predis\Commands\ServerEval',
             'evalsha'                   => '\Predis\Commands\ServerEvalSHA',
+            'script'                    => '\Predis\Commands\ServerScript',
         ));
     }
 }