8000 Document the multi-host DSN for Memcache caches · symfony/symfony-docs@1ae951b · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ae951b

Browse files
committed
Document the multi-host DSN for Memcache caches
1 parent f4b9666 commit 1ae951b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/cache/adapters/memcached_adapter.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ helper method allows creating and configuring a `Memcached`_ class instance usin
6464
// etc...
6565
]);
6666

67+
// a single DSN can define multiple servers using the following syntax:
68+
// host[hostname-or-IP:port] (where port is optional). Sockets must include a trailing ':'
69+
$client = MemcachedAdapter::createConnection(
70+
'memcached:?host[localhost]&host[localhost:12345]&host[/some/memcached.sock:]=3'
71+
);
72+
73+
.. versionadded:: 4.2
74+
75+
The option to define multiple servers in a single DSN was introduced in Symfony 4.2.
76+
6777
The `Data Source Name (DSN)`_ for this adapter must use the following format:
6878

6979
.. code-block:: text

0 commit comments

Comments
 (0)
0