From 48e5df87a3195f9fcb85ee42e6dff157779c4544 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 29 Jan 2019 11:14:57 +0100 Subject: [PATCH] [Cache] fix connecting using socket with phpredis --- src/Symfony/Component/Cache/Traits/RedisTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 43dbb43639..0276c4fb6d 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -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)); }