@@ -344,6 +344,24 @@ public function unwatch( ) {}
344
344
*/
345
345
public function subscribe ( $ channels , $ callback ) {}
346
346
347
+ /**
348
+ * Subscribe to channels by pattern
349
+ *
350
+ * @param array $patterns The number of elements removed from the set.
351
+ * @param string|array $callback Either a string or an array with an object and method.
352
+ * The callback will get four arguments ($redis, $pattern, $channel, $message)
353
+ * @link http://redis.io/commands/psubscribe
354
+ * @example
355
+ * <pre>
356
+ * function psubscribe($redis, $pattern, $chan, $msg) {
357
+ * echo "Pattern: $pattern\n";
358
+ * echo "Channel: $chan\n";
359
+ * echo "Payload: $msg\n";
360
+ * }
361
+ * </pre>
362
+ */
363
+ public function psubscribe ( $ patterns , $ callback ) {}
364
+
347
365
/**
348
366
* Publish messages to channels. Warning: this function will probably change in the future.
349
367
*
@@ -885,13 +903,14 @@ public function lInsert( $key, $position, $pivot, $value ) {}
885
903
886
904
887
905
/**
888
- * Adds a values to the set value stored at key. If this value is already in the set, FALSE is returned.
906
+ * Adds a values to the set value stored at key.
907
+ * If this value is already in the set, FALSE is returned.
889
908
*
890
909
* @param string $key Required key
891
910
* @param string $value1 Required value
892
911
* @param string $value2 Optional value
893
912
* @param string $valueN Optional value
894
- * @return int Number of value added
913
+ * @return int The number of elements added to the set
895
914
* @link http://redis.io/commands/sadd
896
915
* @example
897
916
* <pre>
@@ -909,7 +928,7 @@ public function sAdd( $key, $value1, $value2 = null, $valueN = null ) {}
909
928
* @param string $member1
910
929
* @param string $member2
911
930
* @param string $memberN
912
- * @return int Number of deleted values
931
+ * @return int The number of elements removed from the set.
913
932
* @link http://redis.io/commands/srem
914
933
* @example
915
934
* <pre>
@@ -2376,8 +2395,8 @@ public function zIncrBy( $key, $value, $member ) {}
2376
2395
* $redis->zUnion('ko1', array('k1', 'k2')); // 4, 'ko1' => array('val0', 'val1', 'val2', 'val3')
2377
2396
*
2378
2397
* // Weighted zUnion
2379
- * $redis->zUnion('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko1 ' => array('val0', 'val1', 'val2', 'val3')
2380
- * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko1 ' => array('val0', 'val2', 'val3', 'val1')
2398
+ * $redis->zUnion('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko2 ' => array('val0', 'val1', 'val2', 'val3')
2399
+ * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3 ' => array('val0', 'val2', 'val3', 'val1')
2381
2400
* </pre>
2382
2401
*/
2383
2402
public function zUnion ($ Output , $ ZSetKeys , array $ Weights = null , $ aggregateFunction = 'SUM ' ) {}
@@ -2774,7 +2793,7 @@ public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {}
2774
2793
public function script ( $ command , $ script ) {}
2775
2794
2776
2795
/**
2777
- * The last error message (if any) returned from a SCRIPT call
2796
+ * The last error message (if any)
2778
2797
* @return string A string with the last returned script based error message, or NULL if there is no error
2779
2798
* @example
2780
2799
* <pre>
@@ -2785,13 +2804,30 @@ public function script( $command, $script ) {}
2785
2804
*/
2786
2805
public function getLastError () {}
2787
2806
2807
+ /**
2808
+ * Clear the last error message
2809
+ *
2810
+ * @return bool true
2811
+ * @example
2812
+ * <pre>
2813
+ * $redis->set('x', 'a');
2814
+ * $redis->incr('x');
2815
+ * $err = $redis->getLastError();
2816
+ * // "ERR value is not an integer or out of range"
2817
+ * $redis->clearLastError();
2818
+ * $err = $redis->getLastError();
2819
+ * // NULL
2820
+ * </pre>
2821
+ */
2822
+ public function clearLastError () {}
2823
+
2788
2824
/**
2789
2825
* A utility method to prefix the value with the prefix setting for phpredis.
2790
2826
* @param $value The value you wish to prefix
2791
2827
* @return string If a prefix is set up, the value now prefixed. If there is no prefix, the value will be returned unchanged.
2792
2828
* @example
2793
2829
* <pre>
2794
- * $redis->setOpt (Redis::OPT_PREFIX, 'my-prefix:');
2830
+ * $redis->setOption (Redis::OPT_PREFIX, 'my-prefix:');
2795
2831
* $redis->_prefix('my-value'); // Will return 'my-prefix:my-value'
2796
2832
* </pre>
2797
2833
*/
@@ -2806,7 +2842,7 @@ public function _prefix( $value ) {}
2806
2842
* @return mixed
2807
2843
* @example
2808
2844
* <pre>
2809
- * $redis->setOpt (Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
2845
+ * $redis->setOption (Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
2810
2846
* $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3)
2811
2847
* </pre>
2812
2848
*/
0 commit comments