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)
66
66
case 'semaphore ' === $ connection :
67
67
return new SemaphoreStore ();
68
68
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: ' ):
72
72
if (!class_exists (AbstractAdapter::class)) {
73
73
throw new InvalidArgumentException (sprintf ('Unsupported DSN "%s". Try running "composer require symfony/cache". ' , $ connection ));
74
74
}
75
- $ storeClass = 0 === strpos ($ connection , 'memcached:// ' ) ? MemcachedStore::class : RedisStore::class;
75
+ $ storeClass = 0 === strpos ($ connection , 'memcached: ' ) ? MemcachedStore::class : RedisStore::class;
76
76
$ connection = AbstractAdapter::createConnection ($ connection , ['lazy ' => true ]);
77
77
78
78
return new $ storeClass ($ connection );
Original file line number Diff line number Diff line change @@ -58,12 +58,14 @@ public function validConnections()
58
58
}
59
59
if (class_exists (\Memcached::class) && class_exists (AbstractAdapter::class)) {
60
60
yield ['memcached://server.com ' , MemcachedStore::class];
61
+ yield ['memcached:?host[localhost]&host[localhost:12345] ' , MemcachedStore::class];
61
62
}
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)) {
63
64
yield ['redis://localhost ' , RedisStore::class];
64
65
yield ['redis://localhost?lazy=1 ' , RedisStore::class];
65
66
yield ['redis://localhost?redis_cluster=1 ' , RedisStore::class];
66
67
yield ['redis://localhost?redis_cluster=1&lazy=1 ' , RedisStore::class];
68
+ yield ['redis:?host[localhost]&host[localhost:6379]&redis_cluster=1 ' , RedisStore::class];
67
69
}
68
70
if (class_exists (\PDO ::class)) {
69
71
yield ['sqlite:/tmp/sqlite.db ' , PdoStore::class];
You can’t perform that action at this time.
0 commit comments