Check redis extension version
This commit is contained in:
parent
c276f0dfd6
commit
841d85a7ce
@ -188,7 +188,7 @@ trait RedisTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ['stream' => $params['ssl'] ?? null]);
|
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...\defined('Redis::SCAN_PREFIX') ? [['stream' => $params['ssl'] ?? null]] : []);
|
||||||
|
|
||||||
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
|
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
|
||||||
$isConnected = $redis->isConnected();
|
$isConnected = $redis->isConnected();
|
||||||
@ -251,7 +251,7 @@ trait RedisTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent'], $params['auth'] ?? '', $params['ssl'] ?? null);
|
$redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent'], $params['auth'] ?? '', ...\defined('Redis::SCAN_PREFIX') ? [$params['ssl'] ?? null] : []);
|
||||||
} catch (\RedisClusterException $e) {
|
} catch (\RedisClusterException $e) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e->getMessage());
|
throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e->getMessage());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user