Эх сурвалжийг харах

Add support for transparent key prefixing to EVAL and the Predis\Commands\ScriptedCommand class.

Daniele Alessandri 14 жил өмнө
parent
commit
909b06e805

+ 8 - 0
lib/Predis/Commands/ServerEval.php

@@ -7,6 +7,14 @@ class ServerEval extends Command {
         return 'EVAL';
     }
 
+    protected function onPrefixKeys(Array $arguments, $prefix) {
+        $arguments = $this->getArguments();
+        for ($i = 2; $i < $arguments[1] + 2; $i++) {
+            $arguments[$i] = "$prefix{$arguments[$i]}";
+        }
+        return $arguments;
+    }
+
     protected function canBeHashed() {
         return false;
     }