4
4
* @author Max Kamashev <[email protected] >
5
5
* @link https://github.com/ukko/phpredis-phpdoc
6
6
*
7
- * @method echo string $string Sends a string to Redis, which replies with the same string
7
+ * @method echo ( $string )
8
+ * Sends a string to Redis, which replies with the same string
9
+ * @param string $string Sends a string to Redis, which replies with the same string
10
+ * @return string
8
11
*
9
- * @method eval( $script, $args = array(), $numKeys = 0 )
12
+ * @method eval( $script, $args = array(), $numKeys = 0 )
10
13
* Evaluate a LUA script serverside
11
14
* @param string $script
12
15
* @param array $args
@@ -132,24 +135,44 @@ public function open( $host, $port = 6379, $timeout = 0.0 ) {}
132
135
* @return bool TRUE on success, FALSE on error.
133
136
* @example
134
137
* <pre>
135
- * $redis->connect ('127.0.0.1', 6379);
136
- * $redis->connect ('127.0.0.1'); // port 6379 by default
137
- * $redis->connect ('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
138
- * $redis->connect ('/tmp/redis.sock'); // unix domain socket.
138
+ * $redis->pconnect ('127.0.0.1', 6379);
139
+ * $redis->pconnect ('127.0.0.1'); // port 6379 by default
140
+ * $redis->pconnect ('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
141
+ * $redis->pconnect ('/tmp/redis.sock'); // unix domain socket.
139
142
* </pre>
140
143
*/
141
144
public function pconnect ( $ host , $ port = 6379 , $ timeout = 0.0 ) {}
142
145
143
146
/**
144
- * @see pconnect()
145
- * @param string $host
146
- * @param int $port
147
- * @param float $timeout
147
+ * Connects to a Redis instance or reuse a connection already established with pconnect/popen.
148
+ *
149
+ * The connection will not be closed on close or end of request until the php process ends.
150
+ * So be patient on to many open FD's (specially on redis server side) when using persistent connections on
151
+ * many servers connecting to one redis server.
152
+ *
153
+ * Also more than one persistent connection can be made identified by either host + port + timeout
154
+ * or unix socket + timeout.
155
+ *
156
+ * This feature is not available in threaded versions. pconnect and popen then working like their non persistent
157
+ * equivalents.
158
+ *
159
+ * @param string $host can be a host, or the path to a unix domain socket
160
+ * @param int $port optional
161
+ * @param float $timeout value in seconds (optional, default is 0 meaning unlimited)
162
+ * @return bool TRUE on success, FALSE on error.
163
+ * @example
164
+ * <pre>
165
+ * $redis->pconnect('127.0.0.1', 6379);
166
+ * $redis->pconnect('127.0.0.1'); // port 6379 by default
167
+ * $redis->pconnect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
168
+ * $redis->pconnect('/tmp/redis.sock'); // unix domain socket.
169
+ * </pre>
148
170
*/
149
171
public function popen ( $ host , $ port = 6379 , $ timeout = 0.0 ) {}
150
172
151
173
/**
152
174
* Disconnects from the Redis instance, except when pconnect is used.
175
+ * @return bool
153
176
*/
154
177
public function close ( ) {}
155
178
@@ -192,7 +215,8 @@ public function ping( ) {}
192
215
* Get the value related to the specified key
193
216
*
194
217
* @param string $key
195
- * @return string|bool: If key didn't exist, FALSE is returned. Otherwise, the value related to this key is returned.
218
+ * @return mixed|bool: If key didn't exist, FALSE is returned. Otherwise, the value related to this key is returned.
219
+ * If Redis::OPT_SERIALIZER has been set return value will depend on the data stored
196
220
* @link http://redis.io/commands/get
197
221
* @example $redis->get('key');
198
222
*/
@@ -299,20 +323,22 @@ public function multi( $mode = Redis::MULTI ) {}
299
323
/**
300
324
* @see multi()
301
325
* @link http://redis.io/commands/exec
326
+ * @return bool[] the results of each operation
302
327
*/
303
328
public function exec ( ) {}
304
329
305
330
/**
306
331
* @see multi()
307
332
* @link http://redis.io/commands/discard
333
+ * @return bool
308
334
*/
309
335
public function discard ( ) {}
310
336
311
337
/**
312
338
* Watches a key for modifications by another client. If the key is modified between WATCH and EXEC,
313
339
* the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client.
314
340
* @param string | array $key: a list of keys
315
- * @return void
341
+ * @return bool
316
342
* @link http://redis.io/commands/watch
317
343
* @example
318
344
* <pre>
@@ -328,6 +354,7 @@ public function watch( $key ) {}
328
354
329
355
/**
330
356
* @see watch()
357
+ * @return bool
331
358
* @link http://redis.io/commands/unwatch
332
359
*/
333
360
public function unwatch ( ) {}
@@ -369,7 +396,7 @@ public function subscribe( $channels, $callback ) {}
369
396
* @param array $patterns The number of elements removed from the set.
370
397
* @param string|array $callback Either a string or an array with an object and method.
371
398
* The callback will get four arguments ($redis, $pattern, $channel, $message)
372
- * @param mixed Any non-null return value in the callback will be returned to the caller.
399
+ * @return mixed Any non-null return value in the callback will be returned to the caller.
373
400
* @link http://redis.io/commands/psubscribe
374
401
* @example
375
402
* <pre>
@@ -760,6 +787,8 @@ public function lLen( $key ) {}
760
787
/**
761
788
* @see lLen()
762
789
* @param string $key
790
+ * @return int The size of the list identified by Key exists.
791
+ * bool FALSE if the data type identified by Key is not list
763
792
* @link http://redis.io/commands/llen
764
793
*/
765
794
public function lSize ( $ key ) {}
@@ -790,6 +819,7 @@ public function lIndex( $key, $index ) {}
790
819
* @see lIndex()
791
820
* @param string $key
792
821
* @param int $index
822
+ * @return String the element at this index
793
823
* @link http://redis.io/commands/lindex
794
824
*/
795
825
public function lGet ( $ key , $ index ) {}
@@ -842,6 +872,7 @@ public function lRange( $key, $start, $end ) {}
842
872
* @param string $key
843
873
* @param int $start
844
874
* @param int $end
875
+ * @return array containing the values in specified range.
845
876
*/
846
877
public function lGetRange ( $ key , $ start , $ end ) {}
847
878
@@ -872,6 +903,7 @@ public function lTrim( $key, $start, $stop ) {}
872
903
* @param string $key
873
904
* @param int $start
874
905
* @param int $stop
906
+ * @return array Bool return FALSE if the key identify a non-list value.
875
907
*/
876
908
public function listTrim ( $ key , $ start , $ stop ) {}
877
909
@@ -908,6 +940,7 @@ public function lRem( $key, $value, $count ) {}
908
940
* @param string $key
909
941
* @param string $value
910
942
* @param int $count
943
+ * @return int the number of elements to remove
911
944
*/
912
945
public function lRemove ( $ key , $ value , $ count ) {}
913
946
@@ -992,6 +1025,7 @@ public function sRem( $key, $member1, $member2 = null, $memberN = null ) {}
992
1025
* @param string $member1
993
1026
* @param string $member2
994
1027
* @param string $memberN
1028
+ * @return int The number of elements removed from the set.
995
1029
*/
996
1030
public function sRemove ( $ key , $ member1 , $ member2 = null , $ memberN = null ) {}
997
1031
@@ -1043,6 +1077,7 @@ public function sIsMember( $key, $value ) {}
1043
1077
* @link http://redis.io/commands/sismember
1044
1078
* @param string $key
1045
1079
* @param string $value
1080
+ * @return bool TRUE if value is a member of the set at key key, FALSE otherwise.
1046
1081
*/
1047
1082
public function sContains ( $ key , $ value ) {}
1048
1083
@@ -1355,6 +1390,7 @@ public function sMembers( $key ) {}
1355
1390
/**
1356
1391
* @see sMembers()
1357
1392
* @param string $key
1393
+ * @return array An array of elements, the contents of the set.
1358
1394
* @link http://redis.io/commands/smembers
1359
1395
*/
1360
1396
public function sGetMembers ( $ key ) {}
@@ -1466,6 +1502,7 @@ public function rename( $srcKey, $dstKey ) {}
1466
1502
* @link http://redis.io/commands/rename
1467
1503
* @param string $srcKey
1468
1504
* @param string $dstKey
1505
+ * @return bool: TRUE in case of success, FALSE in case of failure.
1469
1506
*/
1470
1507
public function renameKey ( $ srcKey , $ dstKey ) {}
1471
1508
@@ -1494,7 +1531,7 @@ public function renameNx( $srcKey, $dstKey ) {}
1494
1531
*
1495
1532
* @param string $key The key that will disappear.
1496
1533
* @param int $ttl The key's remaining Time To Live, in seconds.
1497
- * @return bool: TRUE in case of success, FALSE in case of failure.
1534
+ * @return bool TRUE in case of success, FALSE in case of failure.
1498
1535
* @link http://redis.io/commands/expire
1499
1536
* @example
1500
1537
* <pre>
@@ -1511,7 +1548,7 @@ public function expire( $key, $ttl ) {}
1511
1548
*
1512
1549
* @param string $key The key that will disappear.
1513
1550
* @param int $ttl The key's remaining Time To Live, in milliseconds.
1514
- * @return bool: TRUE in case of success, FALSE in case of failure.
1551
+ * @return bool TRUE in case of success, FALSE in case of failure.
1515
1552
* @link http://redis.io/commands/pexpire
1516
1553
* @example
1517
1554
* <pre>
@@ -1527,6 +1564,7 @@ public function pExpire( $key, $ttl ) {}
1527
1564
* @see expire()
1528
1565
* @param string $key
1529
1566
* @param int $ttl
1567
+ * @return bool TRUE in case of success, FALSE in case of failure.
1530
1568
* @link http://redis.io/commands/expire
1531
1569
*/
1532
1570
public function setTimeout ( $ key , $ ttl ) {}
@@ -1570,7 +1608,7 @@ public function pExpireAt( $key, $timestamp ) {}
1570
1608
* Returns the keys that match a certain pattern.
1571
1609
*
1572
1610
* @param string $pattern pattern, using '*' as a wildcard.
1573
- * @return array of STRING: The keys that match a certain pattern.
1611
+ * @return string[] The keys that match a certain pattern
1574
1612
* @link http://redis.io/commands/keys
1575
1613
* @example
1576
1614
* <pre>
@@ -1583,6 +1621,7 @@ public function keys( $pattern ) {}
1583
1621
/**
1584
1622
* @see keys()
1585
1623
* @param string $pattern
1624
+ * @return string[] The keys that match a certain pattern
1586
1625
* @link http://redis.io/commands/keys
1587
1626
*/
1588
1627
public function getKeys ( $ pattern ) {}
@@ -1759,6 +1798,7 @@ public function getRange( $key, $start, $end ) {}
1759
1798
* @param string $key
1760
1799
* @param int $start
1761
1800
* @param int $end
1801
+ * @return string: the substring
1762
1802
*/
1763
1803
public function substr ( $ key , $ start , $ end ) {}
1764
1804
@@ -2404,6 +2444,7 @@ public function zRemRangeByScore( $key, $start, $end ) {}
2404
2444
* @param string $key
2405
2445
* @param float $start
2406
2446
* @param float $end
2447
+ * @return int The number of values deleted from the sorted set
2407
2448
*/
2408
2449
public function zDeleteRangeByScore ( $ key , $ start , $ end ) {}
2409
2450
@@ -2431,6 +2472,7 @@ public function zRemRangeByRank( $key, $start, $end ) {}
2431
2472
* @param string $key
2432
2473
* @param int $start
2433
2474
* @param int $end
2475
+ * @return int The number of values deleted from the sorted set
2434
2476
* @link http://redis.io/commands/zremrangebyscore
2435
2477
*/
2436
2478
public function zDeleteRangeByRank ( $ key , $ start , $ end ) {}
@@ -2454,6 +2496,7 @@ public function zCard( $key ) {}
2454
2496
/**
2455
2497
* @see zCard()
2456
2498
* @param string $key
2499
+ * @return int the set's cardinality
2457
2500
*/
2458
2501
public function zSize ( $ key ) {}
2459
2502
@@ -2978,9 +3021,10 @@ public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {}
2978
3021
2979
3022
/**
2980
3023
* @see evalSha()
2981
- * @param string $scriptSha
2982
- * @param array $args
2983
- * @param int $numKeys
3024
+ * @param string $scriptSha
3025
+ * @param array $args
3026
+ * @param int $numKeys
3027
+ * @return mixed @see eval()
2984
3028
*/
2985
3029
public function evaluateSha ( $ scriptSha , $ args = array (), $ numKeys = 0 ) {}
2986
3030
0 commit comments