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 7078cdf

Browse filesBrowse files
bug #23045 [Cache] fix Redis scheme detection (xabbuh)
This PR was merged into the 3.2 branch. Discussion ---------- [Cache] fix Redis scheme detection | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22974 | License | MIT | Doc PR | Commits ------- 61685c7 [Cache] fix Redis scheme detection
2 parents 3e92637 + 61685c7 commit 7078cdf
Copy full SHA for 7078cdf

File tree

1 file changed

+6
-1
lines changed
Filter options

1 file changed

+6
-1
lines changed

‎src/Symfony/Component/Cache/Adapter/RedisAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/RedisAdapter.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ public static function createConnection($dsn, array $options = array())
9090
$params['dbindex'] = $m[1];
9191
$params['path'] = substr($params['path'], 0, -strlen($m[0]));
9292
}
93+
if (isset($params['host'])) {
94+
$scheme = 'tcp';
95+
} else {
96+
$scheme = 'unix';
97+
}
9398
$params += array(
9499
'host' => isset($params['host']) ? $params['host'] : $params['path'],
95100
'port' => isset($params['host']) ? 6379 : null,
@@ -120,7 +125,7 @@ public static function createConnection($dsn, array $options = array())
120125
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e, $dsn));
121126
}
122127
} elseif (is_a($class, \Predis\Client::class, true)) {
123-
$params['scheme'] = isset($params['host']) ? 'tcp' : 'unix';
128+
$params['scheme'] = $scheme;
124129
$params['database'] = $params['dbindex'] ?: null;
125130
$params['password'] = $auth;
126131
$redis = new $class((new Factory())->create($params));

0 commit comments

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