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 eb2905e

Browse filesBrowse files
committed
[Lock] Fixed StoreFactory to accept same DSN syntax as AbstractAdapter for memcached
1 parent 62dd10f commit eb2905e
Copy full SHA for eb2905e

File tree

2 files changed

+3
-2
lines changed
Filter options

2 files changed

+3
-2
lines changed

‎src/Symfony/Component/Lock/Store/StoreFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Store/StoreFactory.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public static function createStore($connection)
6868

6969
case 0 === strpos($connection, 'redis:'):
7070
case 0 === strpos($connection, 'rediss:'):
71-
case 0 === strpos($connection, 'memcached://'):
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);

‎src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ 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
}
6263
if ((class_exists(\Redis::class) || class_exists(\Predis\Client::class)) && class_exists(AbstractAdapter::class)) {
6364
yield ['redis://localhost', RedisStore::class];

0 commit comments

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