1 | <?php |
||
29 | class RedisSentinelDatabase extends RedisDatabase |
||
30 | { |
||
31 | /** |
||
32 | * Configuration options specific to Sentinel connection operation |
||
33 | * |
||
34 | * We cannot pass these options as an array to the Predis client. |
||
35 | * Instead, we'll set them on the connection directly using methods |
||
36 | * provided by the SentinelReplication class of the Predis package. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $sentinelConnectionOptionKeys = [ |
||
41 | 'sentinel_timeout', |
||
42 | 'retry_wait', |
||
43 | 'retry_limit', |
||
44 | 'update_sentinels', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * Create an array of single connection clients. |
||
49 | * |
||
50 | * @param array $servers The set of options for each Sentinel connection |
||
51 | * @param array $options The global options shared by all Sentinel clients |
||
52 | * |
||
53 | * @return array Each element contains a Predis client that represents a |
||
54 | * connection defined in the 'redis-sentinel' block in config/database.php |
||
55 | */ |
||
56 | protected function createSingleClients(array $servers, array $options = []) |
||
70 | |||
71 | /** |
||
72 | * Create a Predis client instance for a Redis Sentinel connection |
||
73 | * |
||
74 | * @param array $server The configuration options for the connection |
||
75 | * @param array $options The global options shared by all Sentinel clients |
||
76 | * |
||
77 | * @return Client The Predis Client instance |
||
78 | */ |
||
79 | protected function createSingleClient(array $server, array $options) |
||
101 | |||
102 | /** |
||
103 | * Sets the Sentinel-specific connection options on a Predis Client |
||
104 | * connection |
||
105 | * |
||
106 | * @param Client $client The Predis Client to set options for |
||
107 | * @param array $sentinelOpts The options supported by Predis for |
||
108 | * Sentinel-specific connections |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | protected function setSentinelConnectionOptions( |
||
122 | } |
||
123 |