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.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ $redis = new Redis();
177
177
~~~
178
178
179
179
Starting from version 6.0.0 it's possible to specify configuration options.
180
-
This allows to connect lazily to the server without explicitly invoking`connect`command.
180
+
This allows to connect lazily to the server without explicitly invoking`connect`/`pconnect`.
181
181
182
182
#####*Example*
183
183
@@ -197,10 +197,10 @@ $redis = new Redis([
197
197
]);
198
198
~~~
199
199
200
-
#####*Parameters*
200
+
#####*Parameters* (optional)
201
201
202
-
*host*: string. can be a host,or the path to a unix domain socket.
203
-
*port*: int (default is6379, should be -1for unix domain socket)
202
+
*host*: string, the hostname/FQDN/IP addressor the path to a unix domain socket; since v5.0.0 it is possible to specify schema
203
+
*port*: int, actual port (e.g.`6379`) or`-1` (or`0`)for unix domain socket; setting to <`0` with non-UDS will assume default of`6379`
204
204
*connectTimeout*: float, value in seconds (default is 0 meaning unlimited)
205
205
*retryInterval*: int, value in milliseconds (optional)
206
206
*readTimeout*: float, value in seconds (default is 0 meaning unlimited)
@@ -250,11 +250,11 @@ _**Description**_: Connects to a Redis instance.
250
250
251
251
#####*Parameters*
252
252
253
-
*host*: string. can be a host,or the path to a unix domain socket. Starting from version 5.0.0 it is possible to specify schema
254
-
*port*: int, optional
253
+
*host*: string,*host*: string, the hostname/FQDN/IP addressor the path to a unix domain socket; since v5.0.0 it is possible to specify schema
254
+
*port*: int,actual port (e.g.`6379`) or`-1` (or`0`) for unix domain socket; setting to <`0` with non-UDS will assume default of`6379`,optional
255
255
*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout)
256
256
*reserved*: should be '' if retry_interval is specified
257
-
*retry_interval*: int, value in milliseconds (optional)
257
+
*retry_interval*: int, value in milliseconds,optional
258
258
*read_timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout)
259
259
*others*: array, with PhpRedis >= 5.3.0, it allows setting_auth_ and[_stream_](https://www.php.net/manual/en/context.ssl.php) configuration.
260
260
@@ -291,15 +291,15 @@ connections on many servers connecting to one redis server.
291
291
Also more than one persistent connection can be made identified by either host + port + timeout
292
292
or host + persistent_id or unix socket + timeout.
293
293
294
-
Starting from version 4.2.1, it became possible to use connection pooling by setting INI variable`redis.pconnect.pooling_enabled` to 1.
294
+
Since v4.2.1, it became possible to use connection pooling by setting INI variable`redis.pconnect.pooling_enabled` to 1.
295
295
296
296
This feature is not available in threaded versions.`pconnect` and`popen` then working like their non
297
297
persistent equivalents.
298
298
299
299
#####*Parameters*
300
300
301
-
*host*: string. can be a host,or the path to a unix domain socket. Starting from version 5.0.0 it is possible to specify schema
302
-
*port*: int, optional
301
+
*host*: string,*host*: string, the hostname/FQDN/IP addressor the path to a unix domain socket; since v5.0.0 it is possible to specify schema
302
+
*port*: int,actual port (e.g.`6379`) or`-1` (or`0`) for unix domain socket; setting to <`0` with non-UDS will assume default of`6379`,optional
303
303
*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout)
304
304
*persistent_id*: string. identity for the requested persistent connection
305
305
*retry_interval*: int, value in milliseconds (optional)
@@ -812,7 +812,7 @@ $redis->slowLog('len');
812
812
*[exists](#exists) - Determine if a key exists
813
813
*[expire, pexpire](#expire-pexpire) - Set a key's time to live in seconds
814
814
*[expireAt, pexpireAt](#expireat-pexpireat) - Set the expiration for a key as a UNIX timestamp
815
-
*[keys](#keys) - Find all keys matching the given pattern
815
+
*[keys](#keys-1) - Find all keys matching the given pattern
816
816
*[scan](#scan) - Scan for keys in the keyspace (Redis >= 2.8.0)
817
817
*[migrate](#migrate) - Atomically transfer a key from a Redis instance to another one
818
818
*[move](#move) - Move a key to another database
@@ -836,7 +836,7 @@ _**Description**_: Get the value related to the specified key
836
836
*key*
837
837
838
838
#####*Return value*
839
-
*String* or*Bool*: If keydidn't exist,`FALSE` is returned. Otherwise, the value related to this key is returned.
839
+
*String* or*Bool*: If keydoesn't exist,`FALSE` is returned. Otherwise, the value related to this key is returned.
840
840
841
841
#####*Examples*
842
842
@@ -858,7 +858,7 @@ _**Description**_: Get the value related to the specified key and set its expira
858
858
*`PERSIST` - remove the expiration from the key
859
859
860
860
#####*Return value*
861
-
*String* or*Bool*: If keydidn't exist,`FALSE` is returned. Otherwise, the value related to this key is returned.
861
+
*String* or*Bool*: If keydoesn't exist,`FALSE` is returned. Otherwise, the value related to this key is returned.
862
862
863
863
#####*Examples*
864
864
@@ -873,7 +873,7 @@ _**Description**_: Set the string value in argument as value of the key. If you
873
873
#####*Parameters*
874
874
*Key*
875
875
*Value*
876
-
*Timeout or Options Array* (optional). If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values
876
+
*Timeout or Options Array* (optional). If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values
_**Description**_: Set the string value in argument as value of the key if the key doesn't already exist in the database.
919
919
920
920
#####*Parameters*
921
-
*key*
922
-
*value*
921
+
*Key*
922
+
*Value*
923
923
924
924
#####*Return value*
925
-
*Bool*`TRUE`in case of success,`FALSE` in case of failure.
925
+
*Bool*`TRUE`if the command is successful,`FALSE` in case of failure.
926
926
927
927
#####*Examples*
928
928
~~~php
@@ -940,7 +940,7 @@ An array of keys, or an undefined number of parameters, each a key: *key1* *key2
940
940
*Note*: If you are connecting to Redis server >= 4.0.0 you can remove a key with the`unlink` method in the exact same way you would use`del`. The Redis[unlink](https://redis.io/commands/unlink) command is non-blocking and will perform the actual deletion asynchronously.
941
941
942
942
#####*Return value*
943
-
*Long* Number of keys deleted.
943
+
*Long* Number of keys deleted (`0` if none existed to start with),`FALSE` in case of unexpected failure (i.e. connection, etc.)
944
944
945
945
#####*Examples*
946
946
~~~php
@@ -967,7 +967,7 @@ _**Description**_: Verify if the specified key exists.
967
967
*key*
968
968
969
969
#####*Return value*
970
-
*long*: The numberof keys tested thatdo exist.
970
+
*Long* Numberof keys tested thatexist (`0` if none do),`FALSE` in case of failure.