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

This commit is contained in:
Daniele Alessandri
2011-05-13 20:22:06 +02:00
parent 13ac03e134
commit 909b06e805
+8
View File
@@ -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;
}