Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | protected function configureCacheProvider() |
||
27 | { |
||
28 | if (app()->environment('production') || |
||
29 | config()->get('cache.default') !== 'memcached' |
||
30 | ) { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | try { |
||
35 | if (! class_exists('Memcached')) { |
||
36 | throw new Exception(); |
||
37 | } |
||
38 | |||
39 | (new MemcachedConnector())->connect(config('cache.stores.memcached.servers')); |
||
40 | } catch (Exception $e) { |
||
41 | config()->set('cache.default', 'array'); |
||
42 | } |
||
43 | } |
||
44 | |||
59 |