| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function initCache(Bouncer $instance) |
||
| 33 | { |
||
| 34 | // If no cache available, try to set up APC |
||
| 35 | $cache = $instance->getCache(); |
||
| 36 | if (empty($cache)) { |
||
| 37 | if (function_exists('apc_fetch')) { |
||
| 38 | $cache = new \Bouncer\Cache\Apc(); |
||
| 39 | $instance->setOptions(array('cache' => $cache)); |
||
| 40 | } else { |
||
| 41 | $instance->error('No cache available. A cache is needed to keep performances acceptable.'); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 47 |