|
@@ 38-40 (lines=3) @@
|
| 35 |
|
|
| 36 |
|
$dsn = $this->getDsn(); |
| 37 |
|
if (empty($dsn)) { |
| 38 |
|
if (false === $client->connect($config['host'], $config['port'])) { |
| 39 |
|
throw new ConnectException(sprintf('Could not connect to Redis database on "%s:%s".', $config['host'], $config['port'])); |
| 40 |
|
} |
| 41 |
|
} else { |
| 42 |
|
if (false === $client->connect($dsn->getFirstHost(), $dsn->getFirstPort())) { |
| 43 |
|
throw new ConnectException(sprintf('Could not connect to Redis database on "%s:%s".', $dsn->getFirstHost(), $dsn->getFirstPort())); |
|
@@ 54-56 (lines=3) @@
|
| 51 |
|
$config['database'] = $dsn->getDatabase(); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
if (null !== $config['database'] && false === $client->select($config['database'])) { |
| 55 |
|
throw new ConnectException(sprintf('Could not select Redis database with index "%s".', $config['database'])); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
$pool = new RedisCachePool($client); |
| 59 |
|
|