diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index 9596386b80e..466d78debf2 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -25,9 +25,9 @@ to utilize a cluster of servers to provide redundancy and/or fail-over is also a **Requirements:** At least one `Redis server`_ must be installed and running to use this adapter. Additionally, this adapter requires a compatible extension or library that implements - ``\Redis``, ``\RedisArray``, ``RedisCluster``, or ``\Predis``. + ``\Redis``, ``\RedisArray``, ``RedisCluster``, ``\Relay\Relay`` or ``\Predis``. -This adapter expects a `Redis`_, `RedisArray`_, `RedisCluster`_, or `Predis`_ instance to be +This adapter expects a `Redis`_, `RedisArray`_, `RedisCluster`_, `Relay`_ or `Predis`_ instance to be passed as the first parameter. A namespace and default cache lifetime can optionally be passed as the second and third parameters:: @@ -47,6 +47,10 @@ as the second and third parameters:: $defaultLifetime = 0 ); +.. versionadded:: 6.3 + + Support for `Relay`_ was introduced in Symfony 6.3. + Configure the Connection ------------------------ @@ -165,10 +169,14 @@ array of ``key => value`` pairs representing option names and their respective v Available Options ~~~~~~~~~~~~~~~~~ +.. versionadded:: 6.3 + + ``\Relay\Relay`` support was introduced in Symfony 6.3. + ``class`` (type: ``string``, default: ``null``) - Specifies the connection library to return, either ``\Redis`` or ``\Predis\Client``. - If none is specified, it will return ``\Redis`` if the ``redis`` extension is - available, and ``\Predis\Client`` otherwise. Explicitly set this to ``\Predis\Client`` for Sentinel if you are + Specifies the connection library to return, either ``\Redis``, ``\Relay\Relay`` or ``\Predis\Client``. + If none is specified, fallback value is in following order, depending which one is available first: + ``\Redis``, ``\Relay\Relay``, ``\Predis\Client``. Explicitly set this to ``\Predis\Client`` for Sentinel if you are running into issues when retrieving master information. ``persistent`` (type: ``int``, default: ``0``) @@ -258,6 +266,7 @@ Read more about this topic in the official `Redis LRU Cache Documentation`_. .. _`Redis`: https://github.com/phpredis/phpredis .. _`RedisArray`: https://github.com/phpredis/phpredis/blob/master/arrays.markdown#readme .. _`RedisCluster`: https://github.com/phpredis/phpredis/blob/master/cluster.markdown#readme +.. _`Relay`: https://relay.so/ .. _`Predis`: https://packagist.org/packages/predis/predis .. _`Predis Connection Parameters`: https://github.com/nrk/predis/wiki/Connection-Parameters#list-of-connection-parameters .. _`TCP-keepalive`: https://redis.io/topics/clients#tcp-keepalive diff --git a/components/lock.rst b/components/lock.rst index 85f528b140d..119c3074fae 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -602,8 +602,12 @@ store locks and does not expire. RedisStore ~~~~~~~~~~ +.. versionadded:: 6.3 + + ``\Relay\Relay`` support was introduced in Symfony 6.3. + The RedisStore saves locks on a Redis server, it requires a Redis connection -implementing the ``\Redis``, ``\RedisArray``, ``\RedisCluster`` or +implementing the ``\Redis``, ``\RedisArray``, ``\RedisCluster``, ``\Relay\Relay`` or ``\Predis`` classes. This store does not support blocking, and expects a TTL to avoid stalled locks:: diff --git a/session.rst b/session.rst index d6db9408428..007337569fc 100644 --- a/session.rst +++ b/session.rst @@ -503,7 +503,7 @@ a Symfony service for the connection to the Redis server: # - { 'prefix': 'my_prefix', 'ttl': 600 } Redis: - # you can also use \RedisArray, \RedisCluster or \Predis\Client classes + # you can also use \RedisArray, \RedisCluster, \Relay\Relay or \Predis\Client classes class: Redis calls: - connect: @@ -526,7 +526,7 @@ a Symfony service for the connection to the Redis server: xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd"> - + %env(REDIS_HOST)% @@ -565,7 +565,7 @@ a Symfony service for the connection to the Redis server: use Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler; $container - // you can also use \RedisArray, \RedisCluster or \Predis\Client classes + // you can also use \RedisArray, \RedisCluster, \Relay\Relay or \Predis\Client classes ->register('Redis', \Redis::class) ->addMethodCall('connect', ['%env(REDIS_HOST)%', '%env(int:REDIS_PORT)%']) // uncomment the following if your Redis server requires a password: