瀏覽代碼

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

Daniele Alessandri 15 年之前
父節點
當前提交
2eb68a0fee
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lib/Predis.php

+ 6 - 0
lib/Predis.php

@@ -1457,6 +1457,8 @@ class RedisServer_vNext extends RedisServer_v1_2 {
             'discard'   => '\Predis\Commands\Discard',
 
             /* commands operating on string values */
+            'setex'     => '\Predis\Commands\SetExpire',
+            'setExpire' => '\Predis\Commands\SetExpire',
             'append'    => '\Predis\Commands\Append',
             'substr'    => '\Predis\Commands\Substr',
 
@@ -1810,6 +1812,10 @@ class Set extends \Predis\MultiBulkCommand {
     public function getCommandId() { return 'SET'; }
 }
 
+class SetExpire extends \Predis\MultiBulkCommand {
+    public function getCommandId() { return 'SETEX'; }
+}
+
 class SetPreserve extends \Predis\MultiBulkCommand {
     public function getCommandId() { return 'SETNX'; }
     public function parseResponse($data) { return (bool) $data; }