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