Skip to content

Commit 5bd0790

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: [Cache] Updated invalid service names Show how to configure lifetime for app.cache.
2 parents 1115e13 + 7aafce9 commit 5bd0790

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:password@example.com"/>
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
@@ -1984,30 +1984,30 @@ default_doctrine_provider
19841984
**type**: ``string``
19851985

19861986
The service name to use as your default Doctrine provider. The provider is
1987-
available as the ``cache.doctrine`` service.
1987+
available as the ``cache.default_doctrine_provider`` service.
19881988

19891989
default_psr6_provider
19901990
.....................
19911991

19921992
**type**: ``string``
19931993

19941994
The service name to use as your default PSR-6 provider. It is available as
1995-
the ``cache.psr6`` service.
1995+
the ``cache.default_psr6_provider`` service.
19961996

19971997
default_redis_provider
19981998
......................
19991999

20002000
**type**: ``string`` **default**: ``redis://localhost``
20012001

2002-
The DSN to use by the Redis provider. The provider is available as the ``cache.redis``
2002+
The DSN to use by the Redis provider. The provider is available as the ``cache.default_redis_provider``
20032003
service.
20042004

20052005
default_memcached_provider
20062006
..........................
20072007

20082008
**type**: ``string`` **default**: ``memcached://localhost``
20092009

2010-
The DSN to use by the Memcached provider. The provider is available as the ``cache.memcached``
2010+
The DSN to use by the Memcached provider. The provider is available as the ``cache.default_memcached_provider``
20112011
service.
20122012

20132013
default_pdo_provider

0 commit comments

Comments
 (0)