1 | <?php |
||
20 | class VersionedManagerFactory |
||
21 | { |
||
22 | /** |
||
23 | * The current application instance that Laravel's RedisManager depends on |
||
24 | * in version 5.7+. |
||
25 | * |
||
26 | * @var Container |
||
27 | */ |
||
28 | protected $app; |
||
29 | |||
30 | /** |
||
31 | * Detects the application version and provides configuration values. |
||
32 | * |
||
33 | * @var ConfigurationLoader |
||
34 | */ |
||
35 | protected $config; |
||
36 | |||
37 | /** |
||
38 | * Create a factory using the provided configuration. |
||
39 | * |
||
40 | * @param Container $app The current application instance that |
||
41 | * Laravel's RedisManager depends on in version 5.7+. |
||
42 | * @param ConfigurationLoader $config Detects the application version and |
||
43 | * provides configuration values. |
||
44 | */ |
||
45 | public function __construct(Container $app, ConfigurationLoader $config) |
||
50 | |||
51 | /** |
||
52 | * Create an instance of the package's core Redis Sentinel service. |
||
53 | * |
||
54 | * @param Container $app The current application instance that |
||
55 | * Laravel's RedisManager depends on in version 5.7+. |
||
56 | * @param ConfigurationLoader $config Detects the application version and |
||
57 | * provides configuration values. |
||
58 | * |
||
59 | * @return \Monospice\LaravelRedisSentinel\Contracts\Factory A configured |
||
60 | * Redis Sentinel connection manager. |
||
61 | */ |
||
62 | public static function make(Container $app, ConfigurationLoader $config) |
||
66 | |||
67 | /** |
||
68 | * Create an instance of the package's core Redis Sentinel service. |
||
69 | * |
||
70 | * @return \Monospice\LaravelRedisSentinel\Contracts\Factory A configured |
||
71 | * Redis Sentinel connection manager. |
||
72 | */ |
||
73 | public function makeInstance() |
||
87 | |||
88 | /** |
||
89 | * Get the fully-qualified class name of the RedisSentinelManager class |
||
90 | * for the current version of Laravel or Lumen. |
||
91 | * |
||
92 | * @return string The class name of the appropriate RedisSentinelManager |
||
93 | * with its namespace. |
||
94 | */ |
||
95 | protected function getVersionedRedisSentinelManagerClass() |
||
109 | |||
110 | /** |
||
111 | * Determine whether the current Laravel framework version is less than the |
||
112 | * specified version. |
||
113 | * |
||
114 | * @param string $version The version to compare to the current version. |
||
115 | * |
||
116 | * @return bool TRUE current framework version is less than the specified |
||
117 | * version. |
||
118 | */ |
||
119 | protected function appVersionLessThan($version) |
||
125 | } |
||
126 |