1 | <?php |
||
27 | class RedisSentinelServiceProvider extends ServiceProvider |
||
28 | { |
||
29 | /** |
||
30 | * Boot the service by registering extensions with Laravel's cache, queue, |
||
31 | * and session managers for the "redis-sentinel" driver. |
||
32 | * |
||
33 | * @return void |
||
34 | */ |
||
35 | public function boot() |
||
52 | |||
53 | /** |
||
54 | * Bind the "redis-sentinel" database driver to the application service |
||
55 | * container. |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | public function register() |
||
77 | |||
78 | /** |
||
79 | * Replace the standard Laravel Redis service with the Redis Sentinel |
||
80 | * database driver so all redis operations use Sentinel connections. |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | protected function registerOverrides() |
||
94 | |||
95 | /** |
||
96 | * Add "redis-sentinel" as an available driver option to the Laravel cache |
||
97 | * manager. |
||
98 | * |
||
99 | * @param CacheManager $cache The Laravel cache manager |
||
100 | * |
||
101 | * @return void |
||
102 | */ |
||
103 | protected function addRedisSentinelCacheDriver(CacheManager $cache) |
||
114 | |||
115 | /** |
||
116 | * Add "redis-sentinel" as an available driver option to the Laravel |
||
117 | * session manager. |
||
118 | * |
||
119 | * @param SessionManager $session The Laravel session manager |
||
120 | * |
||
121 | * @return void |
||
122 | */ |
||
123 | protected function addRedisSentinelSessionHandler(SessionManager $session) |
||
137 | |||
138 | /** |
||
139 | * Add "redis-sentinel" as an available queue connection driver option to |
||
140 | * the Laravel queue manager. |
||
141 | * |
||
142 | * @param QueueManager $queue The Laravel queue manager |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | protected function addRedisSentinelQueueConnector(QueueManager $queue) |
||
154 | |||
155 | /** |
||
156 | * Determine whether this package should replace Laravel's Redis API |
||
157 | * ("Redis" facade and "redis" service binding). |
||
158 | * |
||
159 | * @return bool True if "database.redis.driver" configuration option is |
||
160 | * set to "sentinel" |
||
161 | */ |
||
162 | protected function shouldOverrideLaravelApi() |
||
168 | |||
169 | /** |
||
170 | * Get the fully-qualified class name of the RedisSentinelManager class |
||
171 | * for the current version of Laravel. |
||
172 | * |
||
173 | * @return string The class name of the appropriate RedisSentinelManager |
||
174 | * with its namespace |
||
175 | */ |
||
176 | protected function getVersionedRedisSentinelManagerClass() |
||
184 | } |
||
185 |