diff --git a/src/Symfony/Component/Lock/Store/StoreFactory.php b/src/Symfony/Component/Lock/Store/StoreFactory.php index b9a5c1e5ca92..2e9172ff99fa 100644 --- a/src/Symfony/Component/Lock/Store/StoreFactory.php +++ b/src/Symfony/Component/Lock/Store/StoreFactory.php @@ -66,13 +66,13 @@ public static function createStore($connection) case 'semaphore' === $connection: return new SemaphoreStore(); - case 0 === strpos($connection, 'redis://'): - case 0 === strpos($connection, 'rediss://'): - case 0 === strpos($connection, 'memcached://'): + case 0 === strpos($connection, 'redis:'): + case 0 === strpos($connection, 'rediss:'): + case 0 === strpos($connection, 'memcached:'): if (!class_exists(AbstractAdapter::class)) { throw new InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); } - $storeClass = 0 === strpos($connection, 'memcached://') ? MemcachedStore::class : RedisStore::class; + $storeClass = 0 === strpos($connection, 'memcached:') ? MemcachedStore::class : RedisStore::class; $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); return new $storeClass($connection); diff --git a/src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php b/src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php index 1d88638d26e5..4e85cdc05f30 100644 --- a/src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php @@ -58,12 +58,14 @@ public function validConnections() } if (class_exists(\Memcached::class) && class_exists(AbstractAdapter::class)) { yield ['memcached://server.com', MemcachedStore::class]; + yield ['memcached:?host[localhost]&host[localhost:12345]', MemcachedStore::class]; } - if (class_exists(\Redis::class) && class_exists(AbstractAdapter::class)) { + if ((class_exists(\Redis::class) || class_exists(\Predis\Client::class)) && class_exists(AbstractAdapter::class)) { yield ['redis://localhost', RedisStore::class]; yield ['redis://localhost?lazy=1', RedisStore::class]; yield ['redis://localhost?redis_cluster=1', RedisStore::class]; yield ['redis://localhost?redis_cluster=1&lazy=1', RedisStore::class]; + yield ['redis:?host[localhost]&host[localhost:6379]&redis_cluster=1', RedisStore::class]; } if (class_exists(\PDO::class)) { yield ['sqlite:/tmp/sqlite.db', PdoStore::class]; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy