You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+64-17Lines changed: 64 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
The phpredis extension provides an API for communicating with the [Redis](http://redis.io/) key-value store. It is released under the [PHP License, version 3.01](http://www.php.net/license/3_01.txt).
6
6
This code has been developed and maintained by Owlient from November 2009 to March 2011.
7
7
8
-
You can send comments, patches, questions [here on github](https://github.com/phpredis/phpredis/issues), to [email protected] ([@yowgi](http://twitter.com/yowgi)), or to [email protected] ([@grumi78](http://twitter.com/grumi78)).
8
+
You can send comments, patches, questions [here on github](https://github.com/phpredis/phpredis/issues), to [email protected] ([@yowgi](https://twitter.com/yowgi)), to [email protected] ([@grumi78](https://twitter.com/grumi78)) or to [email protected] ([@yatsukhnenko](https://twitter.com/yatsukhnenko)).
9
9
10
10
11
11
# Table of contents
@@ -82,7 +82,7 @@ You can install install it using Homebrew:
82
82
phpredis can be used to store PHP sessions. To do this, configure `session.save_handler` and `session.save_path` in your php.ini to tell phpredis where to store the sessions:
`session.save_path` can have a simple `host:port` format too, but you need to provide the `tcp://` scheme if you want to use the parameters. The following parameters are available:
@@ -209,6 +209,7 @@ _**Description**_: Connects to a Redis instance.
209
209
*timeout*: float, value in seconds (optional, default is 0 meaning unlimited)
210
210
*reserved*: should be NULL if retry_interval is specified
211
211
*retry_interval*: int, value in milliseconds (optional)
212
+
*read_timeout*: float, value in seconds (optional, default is 0 meaning unlimited)
212
213
213
214
##### *Return value*
214
215
@@ -245,6 +246,7 @@ persistent equivalents.
245
246
*timeout*: float, value in seconds (optional, default is 0 meaning unlimited)
246
247
*persistent_id*: string. identity for the requested persistent connection
247
248
*retry_interval*: int, value in milliseconds (optional)
249
+
*read_timeout*: float, value in seconds (optional, default is 0 meaning unlimited)
248
250
249
251
##### *Return value*
250
252
@@ -1015,18 +1017,38 @@ _**Description**_: Scan the keyspace for keys
1015
1017
*LONG, Optional*: Count of keys per iteration (only a suggestion to Redis)
1016
1018
1017
1019
##### *Return value*
1018
-
*Array, boolean*: This function will return an array of keys or FALSE if there are no more keys
1020
+
*Array, boolean*: This function will return an array of keys or FALSE if Redis returned zero keys
1019
1021
1020
1022
##### *Example*
1021
1023
~~~
1022
-
$it = NULL; /* Initialize our iterator to NULL */
1023
-
$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY); /* retry when we get no keys back */
1024
-
while($arr_keys = $redis->scan($it)) {
1025
-
foreach($arr_keys as $str_key) {
1024
+
1025
+
/* Without enabling Redis::SCAN_RETRY (default condition) */
1026
+
$it = NULL;
1027
+
do {
1028
+
// Scan for some keys
1029
+
$arr_keys = $redis->scan($it);
1030
+
1031
+
// Redis may return empty results, so protect against that
0 commit comments