[Cache] fix connecting using socket with phpredis

This commit is contained in:
Nicolas Grekas 2019-01-29 11:14:57 +01:00
parent fac1052038
commit 48e5df87a3
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ trait RedisTrait
$initializer = function ($redis) use ($connect, $params, $dsn, $auth, $hosts) {
try {
@$redis->{$connect}($hosts[0]['host'], $hosts[0]['port'], $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
@$redis->{$connect}($hosts[0]['host'] ?? $hosts[0]['path'], $hosts[0]['port'] ?? null, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
} catch (\RedisException $e) {
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn));
}