Skip to content

Commit bcc06ee

Browse files
committed
Remove more wrong changes
1 parent a2c8464 commit bcc06ee

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

components/cache/adapters/redis_adapter.rst

+4-26
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,10 @@ be replaced by ``rediss`` (the second ``s`` means "secure").
6161

6262
.. note::
6363

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

6666
.. code-block:: text
67-
68-
redis[s]://[ip|host|socket[:port]][/db-index]
69-
70-
.. code-block:: text
71-
72-
redis[s]:[ip|host|socket[:port]][&params]
73-
74-
Values for placeholders ``[:port]``, ``[/db-index]`` and ``[&params]`` are optional.
75-
When using Symfony 5.x, you can't define a user or password for the connection
76-
DSN. That feature was added in the following Symfony versions.
67+
redis[s]://[pass@][ip|host|socket[:port]][/db-index]
7768
7869
Below are common examples of valid DSNs showing a combination of available values::
7970

@@ -91,11 +82,8 @@ Below are common examples of valid DSNs showing a combination of available value
9182
// socket "/var/run/redis.sock" and auth "bad-pass"
9283
RedisAdapter::createConnection('redis://bad-pass@/var/run/redis.sock');
9384

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

10088
// a single DSN can also define multiple servers
10189
RedisAdapter::createConnection(
@@ -110,16 +98,6 @@ parameter to set the name of your service group::
11098
'redis:?host[redis1:26379]&host[redis2:26379]&host[redis3:26379]&redis_sentinel=mymaster'
11199
);
112100

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

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

0 commit comments

Comments
 (0)