Skip to content

Commit f6fbdf5

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Cache] Mention that user/password are not supported for Redis DSN
2 parents 0402ace + 28ea058 commit f6fbdf5

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

components/cache/adapters/redis_adapter.rst

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,18 @@ helper method allows creating and configuring the Redis client class instance us
5959
'redis://localhost'
6060
);
6161

62-
The DSN can specify either an IP/host (and an optional port) or a socket path, as well as a
63-
password and a database index. To enable TLS for connections, the scheme ``redis`` must be
64-
replaced by ``rediss`` (the second ``s`` means "secure").
62+
The DSN can specify either an IP/host (and an optional port) or a socket path, as
63+
well as a database index. To enable TLS for connections, the scheme ``redis`` must
64+
be replaced by ``rediss`` (the second ``s`` means "secure").
6565

6666
.. note::
6767

68-
A `Data Source Name (DSN)`_ for this adapter must use either one of the following formats.
68+
A `Data Source Name (DSN)`_ for this adapter must use the following format.
6969

7070
.. code-block:: text
7171
7272
redis[s]://[pass@][ip|host|socket[:port]][/db-index]
7373
74-
.. code-block:: text
75-
76-
redis[s]:[[user]:pass@]?[ip|host|socket[:port]][&params]
77-
78-
Values for placeholders ``[user]``, ``[:port]``, ``[/db-index]`` and ``[&params]`` are optional.
79-
8074
Below are common examples of valid DSNs showing a combination of available values::
8175

8276
use Symfony\Component\Cache\Adapter\RedisAdapter;
@@ -93,11 +87,8 @@ Below are common examples of valid DSNs showing a combination of available value
9387
// socket "/var/run/redis.sock" and auth "bad-pass"
9488
RedisAdapter::createConnection('redis://bad-pass@/var/run/redis.sock');
9589

96-
// host "redis1" (docker container) with alternate DSN syntax and selecting database index "3"
97-
RedisAdapter::createConnection('redis:?host[redis1:6379]&dbindex=3');
98-
99-
// providing credentials with alternate DSN syntax
100-
RedisAdapter::createConnection('redis:default:verysecurepassword@?host[redis1:6379]&dbindex=3');
90+
// a single DSN can define multiple servers using the following syntax:
91+
// host[hostname-or-IP:port] (where port is optional). Sockets must include a trailing ':'
10192

10293
// a single DSN can also define multiple servers
10394
RedisAdapter::createConnection(
@@ -112,16 +103,6 @@ parameter to set the name of your service group::
112103
'redis:?host[redis1:26379]&host[redis2:26379]&host[redis3:26379]&redis_sentinel=mymaster'
113104
);
114105

115-
// providing credentials
116-
RedisAdapter::createConnection(
117-
'redis:default:verysecurepassword@?host[redis1:26379]&host[redis2:26379]&host[redis3:26379]&redis_sentinel=mymaster'
118-
);
119-
120-
// providing credentials and selecting database index "3"
121-
RedisAdapter::createConnection(
122-
'redis:default:verysecurepassword@?host[redis1:26379]&host[redis2:26379]&host[redis3:26379]&redis_sentinel=mymaster&dbindex=3'
123-
);
124-
125106
.. note::
126107

127108
See the :class:`Symfony\\Component\\Cache\\Traits\\RedisTrait` for more options

0 commit comments

Comments
 (0)