New command: HSETNX (Redis v2.0-dev).

This commit is contained in:
Daniele Alessandri
2010-04-23 21:32:10 +02:00
parent b5e2b9eee9
commit a092ad46a3
+7
View File
@@ -1483,6 +1483,8 @@ class RedisServer_vNext extends RedisServer_v1_2 {
/* commands operating on hashes */
'hset' => '\Predis\Commands\HashSet',
'hashSet' => '\Predis\Commands\HashSet',
'hsetnx' => '\Predis\Commands\HashSetPreserve',
'hashSetPreserve' => '\Predis\Commands\HashSetPreserve',
'hmset' => '\Predis\Commands\HashSetMultiple',
'hashSetMultiple' => '\Predis\Commands\HashSetMultiple',
'hincrby' => '\Predis\Commands\HashIncrementBy',
@@ -2143,6 +2145,11 @@ class HashSet extends \Predis\MultiBulkCommand {
public function getCommandId() { return 'HSET'; }
}
class HashSetPreserve extends \Predis\MultiBulkCommand {
public function getCommandId() { return 'HSETNX'; }
public function parseResponse($data) { return (bool) $data; }
}
class HashSetMultiple extends \Predis\MultiBulkCommand {
public function canBeHashed() { return false; }
public function getCommandId() { return 'HMSET'; }