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

Appearance settings

Commit 61b3b46

Browse filesBrowse files
authored
Update RedisTrait.php
[Cache] RedisTrait::createConnection does not pass auth value from redis sentinel cluster DSN
1 parent 27a9df3 commit 61b3b46
Copy full SHA for 61b3b46

File tree

Expand file treeCollapse file tree

1 file changed

+13
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/RedisTrait.php
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public static function createConnection(string $dsn, array $options = [])
207207
break;
208208
}
209209

210-
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
210+
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], $params['auth'] ?? null);
211211

212212
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
213213
[$host, $port] = $address;
@@ -219,7 +219,18 @@ public static function createConnection(string $dsn, array $options = [])
219219
}
220220

221221
try {
222-
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...\defined('Redis::SCAN_PREFIX') ? [['stream' => $params['ssl'] ?? null]] : []);
222+
@$redis->{$connect}(
223+
$host,
224+
$port,
225+
$params['timeout'],
226+
(string) $params['persistent_id'],
227+
$params['retry_interval'],
228+
$params['read_timeout'],
229+
array_merge(
230+
isset($params['auth']) ? ['auth' => $params['auth']] : [],
231+
\defined('Redis::SCAN_PREFIX') ? ['stream' => $params['ssl'] ?? null] : []
232+
)
233+
);
223234

224235
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
225236
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.