From 8ff678ebf0408d054e7fac05bc3e8a293c804f1c Mon Sep 17 00:00:00 2001 From: RusAnd Date: Mon, 4 Apr 2022 12:12:51 +0300 Subject: [PATCH] Support `unix` in `scheme_extensions` --- pkg/redis/PhpRedis.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/redis/PhpRedis.php b/pkg/redis/PhpRedis.php index 241677f68..68121e736 100644 --- a/pkg/redis/PhpRedis.php +++ b/pkg/redis/PhpRedis.php @@ -106,11 +106,12 @@ public function connect(): void $this->redis = new \Redis(); $connectionMethod = $this->config['persistent'] ? 'pconnect' : 'connect'; + $unix = 'unix' === $this->config['scheme'] || in_array('unix', (array) $this->config['scheme_extensions'], true); $result = call_user_func( [$this->redis, $connectionMethod], - 'unix' === $this->config['scheme'] ? $this->config['path'] : $this->config['host'], - $this->config['port'], + $unix ? $this->config['path'] : $this->config['host'], + $unix ? null : $this->config['port'], $this->config['timeout'], $this->config['persistent'] ? ($this->config['phpredis_persistent_id'] ?? null) : null, $this->config['phpredis_retry_interval'] ?? null,