| Conditions | 3 |
| Paths | 10 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function __construct(array $connections, CacheAdapter $next = null) |
||
| 23 | { |
||
| 24 | $this->isRedisExtensionAvailable(); |
||
| 25 | |||
| 26 | try { |
||
| 27 | $connections = \array_values($connections); |
||
| 28 | $this->connected = true; |
||
| 29 | |||
| 30 | $this->redis = new Redis(); |
||
| 31 | $this->redis->connect($connections[0]['host'], $connections[0]['port'], $connections[0]['timeout']); |
||
| 32 | $this->redis->select($connections[0]['database']); |
||
| 33 | } catch (RedisException $e) { |
||
|
|
|||
| 34 | $this->connected = false; |
||
| 35 | } |
||
| 36 | |||
| 37 | $this->nextAdapter = (InMemoryAdapter::getInstance() === $next) ? null: $next; |
||
| 38 | } |
||
| 39 | |||
| 74 |