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 61685c7

Browse filesBrowse files
committed
[Cache] fix Redis scheme detection
1 parent 89c3f5c commit 61685c7
Copy full SHA for 61685c7

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.