Skip to content

Commit 38d5cd0

Browse files
committed
Merge branch '4.2'
* 4.2: [Cache] Updated invalid service names Show how to configure lifetime for app.cache.
2 parents 2037733 + 5bd0790 commit 38d5cd0

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

cache.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
259259
# config/packages/cache.yaml
260260
framework:
261261
cache:
262+
app: my_configured_app_cache
262263
pools:
263264
my_cache_pool:
264265
adapter: cache.adapter.memcached
@@ -269,6 +270,10 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
269270
cache.long_cache:
270271
adapter: my_cache_pool
271272
default_lifetime: 604800
273+
my_configured_app_cache:
274+
# "cache.adapter.filesystem" is the default for "cache.app"
275+
adapter: cache.adapter.filesystem
276+
default_lifetime: 3600
272277
273278
.. code-block:: xml
274279
@@ -281,10 +286,12 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
281286
https://symfony.com/schema/dic/services/services-1.0.xsd">
282287
283288
<framework:config>
284-
<framework:cache>
289+
<framework:cache app="my_cache_pool">
285290
<framework:pool name="my_cache_pool" adapter="cache.adapter.memcached" provider="memcached://user:[email protected]"/>
286291
<framework:pool name="cache.short_cache" adapter="my_cache_pool" default_lifetime="604800"/>
287292
<framework:pool name="cache.long_cache" adapter="my_cache_pool" default_lifetime="604800"/>
293+
<!-- "cache.adapter.filesystem" is the default for "cache.app" -->
294+
<framework:pool name="my_configured_app_cache" adapter="cache.adapter.filesystem" default_lifetime="3600"/>
288295
</framework:cache>
289296
</framework:config>
290297
</container>
@@ -294,6 +301,7 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
294301
// config/packages/cache.php
295302
$container->loadFromExtension('framework', [
296303
'cache' => [
304+
'app' => 'my_configured_app_cache',
297305
'pools' => [
298306
'my_cache_pool' => [
299307
'adapter' => 'cache.adapter.memcached',
@@ -307,6 +315,11 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
307315
'adapter' => 'cache.adapter.memcached',
308316
'default_lifetime' => 604800,
309317
],
318+
'my_configured_app_cache' => [
319+
// "cache.adapter.filesystem" is the default for "cache.app"
320+
'adapter' => 'cache.adapter.filesystem',
321+
'default_lifetime' => 3600,
322+
],
310323
],
311324
],
312325
]);

controller/upload_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Using a Doctrine Listener
333333

334334
If you are using Doctrine to store the Product entity, you can create a
335335
:doc:`Doctrine listener </doctrine/event_listeners_subscribers>` to
336-
automatically upload the file when persisting the entity::
336+
automatically move the file when persisting the entity::
337337

338338
// src/EventListener/BrochureUploadListener.php
339339
namespace App\EventListener;

reference/configuration/framework.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,30 +2059,30 @@ default_doctrine_provider
20592059
**type**: ``string``
20602060

20612061
The service name to use as your default Doctrine provider. The provider is
2062-
available as the ``cache.doctrine`` service.
2062+
available as the ``cache.default_doctrine_provider`` service.
20632063

20642064
default_psr6_provider
20652065
.....................
20662066

20672067
**type**: ``string``
20682068

20692069
The service name to use as your default PSR-6 provider. It is available as
2070-
the ``cache.psr6`` service.
2070+
the ``cache.default_psr6_provider`` service.
20712071

20722072
default_redis_provider
20732073
......................
20742074

20752075
**type**: ``string`` **default**: ``redis://localhost``
20762076

2077-
The DSN to use by the Redis provider. The provider is available as the ``cache.redis``
2077+
The DSN to use by the Redis provider. The provider is available as the ``cache.default_redis_provider``
20782078
service.
20792079

20802080
default_memcached_provider
20812081
..........................
20822082

20832083
**type**: ``string`` **default**: ``memcached://localhost``
20842084

2085-
The DSN to use by the Memcached provider. The provider is available as the ``cache.memcached``
2085+
The DSN to use by the Memcached provider. The provider is available as the ``cache.default_memcached_provider``
20862086
service.
20872087

20882088
default_pdo_provider

0 commit comments

Comments
 (0)