fix(cache): Set default Redis port to `0` for UNIX sockets

When using phpredis with a UNIX socket, the port should either not be specified at all or be `<1`. 

https://github.com/phpredis/phpredis?tab=readme-ov-file#connect-open

d0b0c5cfdd/library.c (L3332-L3334)

Fixes #54813

Signed-off-by: Josh <josh.t.richards@gmail.com>
pull/54944/head
Josh 2025-09-07 14:30:34 +07:00 committed by Andy Scherzinger
parent e2ea21baca
commit 6b9fea9d09
1 changed files with 1 additions and 1 deletions

@ -77,7 +77,7 @@ class RedisFactory {
$this->instance = new \Redis();
$host = $config['host'] ?? '127.0.0.1';
$port = $config['port'] ?? ($host[0] !== '/' ? 6379 : null);
$port = $config['port'] ?? ($host[0] !== '/' ? 6379 : 0);
$this->eventLogger->start('connect:redis', 'Connect to redis and send AUTH, SELECT');
// Support for older phpredis versions not supporting connectionParameters