From 12d2752ccf1685b6c67c3179d298e5d6e75abb64 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 24 Sep 2018 16:12:46 +0200 Subject: [PATCH 1/3] add example for cache pool configuration --- reference/configuration/framework.rst | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 2be0b0e59c9..0a8c07a19dc 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1955,6 +1955,58 @@ A list of cache pools to be created by the framework extension. For more information about how pools works, see :ref:`cache pools `. +To configure a Redis cache pool with a default lifetime of 1 hour, do the following: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + framework: + cache: + pools: + cache.mycache: + adapter: cache.adapter.redis + default_lifetime: 3600 + + .. code-block:: xml + + + + + + + + + + + + + + + + .. code-block:: php + + // config/packages/framework.php + $container->loadFromExtension('framework', array( + 'cache' => array( + 'pools' => array( + 'cache.mycache' => array( + 'adapter' => 'cache.adapter.redis', + 'default_lifetime' => 3600, + ), + ), + ), + )); + .. _reference-cache-pools-name: name From a504dec4d9c2c14a73ecdce6cfdb4f53b847592b Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 3 Oct 2018 17:18:41 +0200 Subject: [PATCH 2/3] fix xml and details --- reference/configuration/framework.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 0a8c07a19dc..abc1159a08c 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1982,12 +1982,11 @@ To configure a Redis cache pool with a default lifetime of 1 hour, do the follow - - - + @@ -2025,7 +2024,8 @@ adapter **type**: ``string`` **default**: ``cache.app`` -The name of the adapter to use. You could also use your own implementation. +The service name of the adapter to use. You can specify one of the default +services or use your own implementation. .. note:: @@ -2061,7 +2061,10 @@ provider **type**: ``string`` -The service name to use as provider when the specified adapter needs one. +Overwrite the default service name or DSN respectively, if you do not want to +use what is configured as ``default_X_provider`` under ``cache``. See the +description of the default provider setting above for the type of adapter +you use for information on how to specify the provider. clearer """"""" From 64be0514a7bee4b8419c6773fb96cb1c76af435a Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 3 Oct 2018 17:42:13 +0200 Subject: [PATCH 3/3] improve adapter documentation --- reference/configuration/framework.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index abc1159a08c..bdf463a8284 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -2025,7 +2025,9 @@ adapter **type**: ``string`` **default**: ``cache.app`` The service name of the adapter to use. You can specify one of the default -services or use your own implementation. +services that follow the pattern ``cache.adapter.[type]``. Alternatively you +can specify another cache pool as base, which will make this pool inherit the +settings from the base pool as defaults. .. note::