1 | <?php |
||
18 | class PredisConnector |
||
19 | { |
||
20 | /** |
||
21 | * Configuration options specific to Sentinel connection operation |
||
22 | * |
||
23 | * We cannot pass these options as an array to the Predis client. |
||
24 | * Instead, we'll set them on the connection directly using methods |
||
25 | * provided by the SentinelReplication class of the Predis package. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $sentinelKeys = [ |
||
30 | 'sentinel_timeout' => null, |
||
31 | 'retry_wait' => null, |
||
32 | 'retry_limit' => null, |
||
33 | 'update_sentinels' => null, |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * Create a new Redis Sentinel connection from the provided configuration |
||
38 | * options |
||
39 | * |
||
40 | * @param array $server The client configuration for the connection |
||
41 | * @param array $options The global client options shared by all Sentinel |
||
42 | * connections |
||
43 | * |
||
44 | * @return PredisConnection The Sentinel connection containing a configured |
||
45 | * Predis Client |
||
46 | */ |
||
47 | public function connect(array $server, array $options = [ ]) |
||
70 | } |
||
71 |