Browse Source

New commands: HSET and HGET (Redis v2.0-dev). NOTE: this is the beginning of the Hashes awesomeness in Redis!

Daniele Alessandri 15 years ago
parent
commit
c6f97a7946
1 changed files with 15 additions and 0 deletions
  1. 15 0
      lib/Predis.php

+ 15 - 0
lib/Predis.php

@@ -1107,6 +1107,12 @@ class RedisServer_vNext extends RedisServer_v1_2 {
                 'zsetCount'             => '\Predis\Commands\ZSetCount',
             'zrank'                     => '\Predis\Commands\ZSetRank',
                 'zsetRank'              => '\Predis\Commands\ZSetRank',
+
+            /* commands operating on hashes */
+            'hset'                      => '\Predis\Commands\HSet',
+                'hashSet'               => '\Predis\Commands\HSet',
+            'hget'                      => '\Predis\Commands\HGet',
+                'hashGet'               => '\Predis\Commands\HGet',
         ));
     }
 }
@@ -1506,6 +1512,15 @@ class ZSetRank extends \Predis\InlineCommand {
     public function getCommandId() { return 'ZRANK'; }
 }
 
+/* commands operating on hashes */
+class HSet extends \Predis\MultiBulkCommand {
+    public function getCommandId() { return 'HSET'; }
+}
+
+class HGet extends \Predis\BulkCommand {
+    public function getCommandId() { return 'HGET'; }
+}
+
 /* multiple databases handling commands */
 class SelectDatabase extends \Predis\InlineCommand {
     public function canBeHashed()  { return false; }