Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbefb81

Browse files
authored
Connect to RedisCluster with password auth
Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example)https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails```RedisAdapter::createConnection( 'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1');```See RedisCluster usage herehttps://github.com/phpredis/phpredis/blob/develop/cluster.markdown#declaring-a-cluster-with-an-array-of-seeds
1 parent8a7c776 commitcbefb81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Cache/Traits/RedisTrait.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public static function createConnection($dsn, array $options = [])
228228
}
229229

230230
try {
231-
$redis =new$class(null,$hosts,$params['timeout'],$params['read_timeout'], (bool)$params['persistent']);
231+
$redis =new$class(null,$hosts,$params['timeout'],$params['read_timeout'], (bool)$params['persistent'],$params['auth'] ??'');
232232
}catch (\RedisClusterException$e) {
233233
thrownewInvalidArgumentException(sprintf('Redis connection "%s" failed:',$dsn).$e->getMessage());
234234
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp