New commands: WATCH and UNWATCH (Redis v2.2-dev).

This commit is contained in:
Daniele Alessandri
2010-06-12 08:16:00 +02:00
parent dd07c12402
commit 5287bb2387
+17
View File
@@ -1658,6 +1658,13 @@ class RedisServer_v2_0 extends RedisServer_v1_2 {
class RedisServer_vNext extends RedisServer_v2_0 {
public function getVersion() { return '2.1'; }
public function getSupportedCommands() {
return array_merge(parent::getSupportedCommands(), array(
/* transactions */
'watch' => '\Predis\Commands\Watch',
'unwatch' => '\Predis\Commands\Unwatch',
));
}
}
/* ------------------------------------------------------------------------- */
@@ -2648,6 +2655,16 @@ class Publish extends \Predis\MultiBulkCommand {
public function getCommandId() { return 'PUBLISH'; }
}
class Watch extends \Predis\MultiBulkCommand {
public function canBeHashed() { return false; }
public function getCommandId() { return 'WATCH'; }
}
class Unwatch extends \Predis\MultiBulkCommand {
public function canBeHashed() { return false; }
public function getCommandId() { return 'UNWATCH'; }
}
/* persistence control commands */
class Save extends \Predis\MultiBulkCommand {
public function canBeHashed() { return false; }