Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af7528d

Browse files
committed
Add documentation for RedisArray auth
1 parent ff1d03f commit af7528d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

arrays.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ This option applies to main and previous ring if specified.
7575
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("consistent" => true));
7676
</pre>
7777

78+
#### Specifying the "auth" parameter
79+
The value is string and used to specify the password for authenticate with the server prior to sending commands
80+
<pre>
81+
$ra = new RedisArray(array("host1", "host2:63792", "host2:6380"), array("auth" => "mysecretpassword"));
82+
</pre>
83+
7884
#### Defining arrays in Redis.ini
7985

8086
Because php.ini parameters must be pre-defined, Redis Arrays must all share the same .ini settings.
@@ -91,6 +97,9 @@ ini_set('redis.arrays.functions', 'users=user_hash');
9197

9298
// use index only for users
9399
ini_set('redis.arrays.index', 'users=1,friends=0');
100+
101+
// use password for authentication
102+
ini_set('redis.arrays.auth', 'users=mysecretpassword')
94103
</pre>
95104

96105
## Usage

0 commit comments

Comments
 (0)