Skip to content

Commit f64bd83

Browse files
committed
Update README.
[ci skip]
1 parent 922e56b commit f64bd83

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,21 @@ $options = ['replication' => 'sentinel', 'service' => 'mymaster'];
230230
$client = new Predis\Client($sentinels, $options);
231231
```
232232

233+
If the master and slave nodes are configured to require an authentication from clients, a password
234+
must be provided via the global `parameters` client option. This option can also be used to specify
235+
a different database index. The client options array would then look like this:
236+
237+
```php
238+
$options = [
239+
'replication' => 'sentinel',
240+
'service' => 'mymaster',
241+
'parameters' => [
242+
'password' => $secretpassword,
243+
'database' => 10,
244+
],
245+
];
246+
```
247+
233248
While Predis is able to distinguish commands performing write and read-only operations, `EVAL` and
234249
`EVALSHA` represent a corner case in which the client switches to the master node because it cannot
235250
tell when a Lua script is safe to be executed on slaves. While this is indeed the default behavior,

0 commit comments

Comments
 (0)