Skip to content

Commit 7e94848

Browse files
Merge branch 'develop' of github.com:phpredis/phpredis into develop
2 parents a4afe91 + 919b1d1 commit 7e94848

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.markdown

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ $redis->connect('127.0.0.1', 6379, 1, NULL, 100); // 1 sec timeout, 100ms delay
225225
_**Description**_: Connects to a Redis instance or reuse a connection already established with `pconnect`/`popen`.
226226

227227
The connection will not be closed on `close` or end of request until the php process ends.
228-
So be patient on too many open FD's (specially on redis server side) when using persistent
228+
So be prepared for too many open FD's errors (specially on redis server side) when using persistent
229229
connections on many servers connecting to one redis server.
230230

231231
Also more than one persistent connection can be made identified by either host + port + timeout
@@ -832,7 +832,11 @@ $redis->incr('key1'); /* key1 didn't exists, set to 0 before the increment */
832832
$redis->incr('key1'); /* 2 */
833833
$redis->incr('key1'); /* 3 */
834834
$redis->incr('key1'); /* 4 */
835-
$redis->incrBy('key1', 10); /* 14 */
835+
836+
// Will redirect, and actually make an INCRBY call
837+
$redis->incr('key1', 10); /* 14 */
838+
839+
$redis->incrBy('key1', 10); /* 24 */
836840
~~~
837841

838842
### incrByFloat
@@ -874,7 +878,11 @@ $redis->decr('key1'); /* key1 didn't exists, set to 0 before the increment */
874878
875879
$redis->decr('key1'); /* -2 */
876880
$redis->decr('key1'); /* -3 */
877-
$redis->decrBy('key1', 10); /* -13 */
881+
882+
// Will redirect, and actually make an DECRBY call
883+
$redis->decr('key1', 10); /* -13 */
884+
885+
$redis->decrBy('key1', 10); /* -23 */
878886
~~~
879887

880888
### mGet, getMultiple
@@ -1808,7 +1816,7 @@ $redis->lGet('key1', 0); /* 'A' */
18081816
$redis->lGet('key1', -1); /* 'C' */
18091817
$redis->lGet('key1', 10); /* `FALSE` */
18101818
~~~
1811-
/
1819+
18121820
### lInsert
18131821
-----
18141822
_**Description**_: Insert value in the list before or after the pivot value.

cluster.markdown

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ $obj_cluster->setOption(RedisCluster::OPT_SLAVE_FAILOVER, RedisCluster::FAILOVER
6565
$obj_cluster->setOption(
6666
RedisCluster::OPT_SLAVE_FAILOVER, RedisCluster::FAILOVER_DISTRIBUTE
6767
);
68+
69+
// Always distribute readonly commands to the slaves, at random
70+
$obj_cluster->setOption(
71+
RedisCluster::OPT_SLAVE_FAILOVER, RedisCluster::FAILOVER_DISTRIBUTE_SLAVES
72+
);
6873
</pre>
6974

7075
## Main command loop
@@ -163,7 +168,7 @@ session.save_path = "seed[]=host1:port1&seed[]=host2:port2&seed[]=hostN:portN&ti
163168
Set this variable to "rediscluster" to inform phpredis that this is a cluster instance.
164169

165170
### session.save_path
166-
The save path for cluster based session storage takes the form of a PHP GET request, and requires that you specify at least on `seed` node. Other options you can specify are as follows:
171+
The save path for cluster based session storage takes the form of a PHP GET request, and requires that you specify at least one `seed` node. Other options you can specify are as follows:
167172

168173
* _timeout (double)_: The amount of time phpredis will wait when connecting or writing to the cluster.
169174
* _read_timeout (double)_: The amount of time phpredis will wait for a result from the cluster.

0 commit comments

Comments
 (0)