1 | <?php |
||
30 | class RedisSentinelDatabase extends RedisDatabase |
||
31 | { |
||
32 | /** |
||
33 | * Configuration options specific to Sentinel connection operation |
||
34 | * |
||
35 | * We cannot pass these options as an array to the Predis client. |
||
36 | * Instead, we'll set them on the connection directly using methods |
||
37 | * provided by the SentinelReplication class of the Predis package. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $sentinelConnectionOptionKeys = [ |
||
42 | 'sentinel_timeout', |
||
43 | 'retry_wait', |
||
44 | 'retry_limit', |
||
45 | 'update_sentinels', |
||
46 | ]; |
||
47 | |||
48 | /** |
||
49 | * Subscribe to a set of given channels for messages. |
||
50 | * |
||
51 | * @param array|string $channels The names of the channels to subscribe to |
||
52 | * @param Closure $callback Executed for each message. Receives the |
||
53 | * message string in the first argument and the message channel as the |
||
54 | * second argument. Return FALSE to unsubscribe. |
||
55 | * @param string|null $connection The connection to subscribe on. |
||
56 | * @param string $method The subscription command ("subscribe" or |
||
57 | * "psubscribe"). |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function subscribe( |
||
70 | |||
71 | /** |
||
72 | * Create an array of single connection clients. |
||
73 | * |
||
74 | * @param array $servers The set of options for each Sentinel connection |
||
75 | * @param array $options The global options shared by all Sentinel clients |
||
76 | * |
||
77 | * @return array Each element contains a Predis client that represents a |
||
78 | * connection defined in the 'redis-sentinel' block in config/database.php |
||
79 | */ |
||
80 | protected function createSingleClients(array $servers, array $options = []) |
||
100 | |||
101 | /** |
||
102 | * Create a Predis client instance for a Redis Sentinel connection |
||
103 | * |
||
104 | * @param array $server The configuration options for the connection |
||
105 | * @param array $options The global options shared by all Sentinel clients |
||
106 | * |
||
107 | * @return Client The Predis Client instance |
||
|
|||
108 | */ |
||
109 | protected function createSingleClient(array $server, array $options) |
||
131 | |||
132 | /** |
||
133 | * Sets the Sentinel-specific connection options on a Predis Client |
||
134 | * connection |
||
135 | * |
||
136 | * @param Client $client The Predis Client to set options for |
||
137 | * @param array $sentinelOpts The options supported by Predis for |
||
138 | * Sentinel-specific connections |
||
139 | * |
||
140 | * @return void |
||
141 | */ |
||
142 | protected function setSentinelConnectionOptions( |
||
152 | } |
||
153 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.