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 212dc53

Browse filesBrowse files
bug #34967 [HttpFoundation] fix redis multi host dsn not recognized (Jan Christoph Beyer)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation] fix redis multi host dsn not recognized | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34477 | License | MIT #34177 added support configurating session handlers with DSNs. It was no possible to pass a redis-DSN like `redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'` since the check was `case 0 === strpos($connection, 'redis://'):` Commits ------- 81ba07a fix redis multi host dsn not recognized
2 parents 0636177 + 81ba07a commit 212dc53
Copy full SHA for 212dc53

File tree

1 file changed

+4
-4
lines changed
Filter options

1 file changed

+4
-4
lines changed

‎src/Symfony/Component/HttpFoundation/Session/Storage/Handler/SessionHandlerFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/SessionHandlerFactory.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public static function createHandler($connection): AbstractSessionHandler
5050
case 0 === strpos($connection, 'file://'):
5151
return new StrictSessionHandler(new NativeFileSessionHandler(substr($connection, 7)));
5252

53-
case 0 === strpos($connection, 'redis://'):
54-
case 0 === strpos($connection, 'rediss://'):
55-
case 0 === strpos($connection, 'memcached://'):
53+
case 0 === strpos($connection, 'redis:'):
54+
case 0 === strpos($connection, 'rediss:'):
55+
case 0 === strpos($connection, 'memcached:'):
5656
if (!class_exists(AbstractAdapter::class)) {
5757
throw new InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection));
5858
}
59-
$handlerClass = 0 === strpos($connection, 'memcached://') ? MemcachedSessionHandler::class : RedisSessionHandler::class;
59+
$handlerClass = 0 === strpos($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class;
6060
$connection = AbstractAdapter::createConnection($connection, ['lazy' => true]);
6161

6262
return new $handlerClass($connection);

0 commit comments

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