mirror of
https://github.com/predis/predis.git
synced 2026-08-31 04:35:05 +00:00
Add an abstraction for a virtual command that leverages Redis scripting with the new EVAL command.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
abstract class ScriptedCommand extends ServerEval {
|
||||
public abstract function getScript();
|
||||
|
||||
public abstract function keysCount();
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
if (($keys = $this->keysCount()) === -1) {
|
||||
$keys = count($arguments);
|
||||
}
|
||||
return array_merge(array($this->getScript(), $keys), $arguments);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user