File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,13 @@ public static function createStore($connection)
6666 case 'semaphore ' === $ connection :
6767 return new SemaphoreStore ();
6868
69- case 0 === strpos ($ connection , 'redis:// ' ):
70- case 0 === strpos ($ connection , 'rediss:// ' ):
71- case 0 === strpos ($ connection , 'memcached:// ' ):
69+ case 0 === strpos ($ connection , 'redis: ' ):
70+ case 0 === strpos ($ connection , 'rediss: ' ):
71+ case 0 === strpos ($ connection , 'memcached: ' ):
7272 if (!class_exists (AbstractAdapter::class)) {
7373 throw new InvalidArgumentException (sprintf ('Unsupported DSN "%s". Try running "composer require symfony/cache". ' , $ connection ));
7474 }
75- $ storeClass = 0 === strpos ($ connection , 'memcached:// ' ) ? MemcachedStore::class : RedisStore::class;
75+ $ storeClass = 0 === strpos ($ connection , 'memcached: ' ) ? MemcachedStore::class : RedisStore::class;
7676 $ connection = AbstractAdapter::createConnection ($ connection , ['lazy ' => true ]);
7777
7878 return new $ storeClass ($ connection );
Original file line number Diff line number Diff line change @@ -58,12 +58,14 @@ public function validConnections()
5858 }
5959 if (class_exists (\Memcached::class) && class_exists (AbstractAdapter::class)) {
6060 yield ['memcached://server.com ' , MemcachedStore::class];
61+ yield ['memcached:?host[localhost]&host[localhost:12345] ' , MemcachedStore::class];
6162 }
62- if (class_exists (\Redis::class) && class_exists (AbstractAdapter::class)) {
63+ if (( class_exists (\Redis::class) || class_exists (\ Predis \Client::class) ) && class_exists (AbstractAdapter::class)) {
6364 yield ['redis://localhost ' , RedisStore::class];
6465 yield ['redis://localhost?lazy=1 ' , RedisStore::class];
6566 yield ['redis://localhost?redis_cluster=1 ' , RedisStore::class];
6667 yield ['redis://localhost?redis_cluster=1&lazy=1 ' , RedisStore::class];
68+ yield ['redis:?host[localhost]&host[localhost:6379]&redis_cluster=1 ' , RedisStore::class];
6769 }
6870 if (class_exists (\PDO ::class)) {
6971 yield ['sqlite:/tmp/sqlite.db ' , PdoStore::class];
You can’t perform that action at this time.
0 commit comments