Skip to content

Commit 411a374

Browse files
committed
Merge branch '4.4'
* 4.4: [Cache] Make sure the chain cache configuration works Fix broken link to doctrine documentation Use single quotes for example code
2 parents 2bcd5ca + 22ab794 commit 411a374

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

cache.rst

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,22 @@ case the value needs to be recalculated.
385385
cache:
386386
pools:
387387
my_cache_pool:
388-
adapter: app.my_cache_chain_adapter
388+
adapter: cache.adapter.psr6
389+
provider: app.my_cache_chain_adapter
389390
cache.my_redis:
390391
adapter: cache.adapter.redis
391392
provider: 'redis://user:[email protected]'
393+
cache.apcu:
394+
adapter: cache.adapter.apcu
395+
cache.array:
396+
adapter: cache.adapter.array
397+
392398
393399
services:
394400
app.my_cache_chain_adapter:
395401
class: Symfony\Component\Cache\Adapter\ChainAdapter
396402
arguments:
397-
- ['cache.adapter.array', 'cache.my_redis', 'cache.adapter.file']
403+
- ['@cache.array', '@cache.apcu', '@cache.my_redis']
398404
- 31536000 # One year
399405
400406
.. code-block:: xml
@@ -409,17 +415,19 @@ case the value needs to be recalculated.
409415
410416
<framework:config>
411417
<framework:cache>
412-
<framework:pool name="my_cache_pool" adapter="app.my_cache_chain_adapter"/>
418+
<framework:pool name="my_cache_pool" adapter="cache.adapter.psr6" provider="app.my_cache_chain_adapter"/>
413419
<framework:pool name="cache.my_redis" adapter="cache.adapter.redis" provider="redis://user:[email protected]"/>
420+
<framework:pool name="cache.apcu" adapter="cache.adapter.apcu"/>
421+
<framework:pool name="cache.array" adapter="cache.adapter.array"/>
414422
</framework:cache>
415423
</framework:config>
416424
417425
<services>
418426
<service id="app.my_cache_chain_adapter" class="Symfony\Component\Cache\Adapter\ChainAdapter">
419427
<argument type="collection">
420-
<argument type="service" value="cache.adapter.array"/>
428+
<argument type="service" value="cache.array"/>
429+
<argument type="service" value="cache.apcu"/>
421430
<argument type="service" value="cache.my_redis"/>
422-
<argument type="service" value="cache.adapter.file"/>
423431
</argument>
424432
<argument>31536000</argument>
425433
</service>
@@ -433,28 +441,37 @@ case the value needs to be recalculated.
433441
'cache' => [
434442
'pools' => [
435443
'my_cache_pool' => [
436-
'adapter' => 'app.my_cache_chain_adapter',
444+
'adapter' => 'cache.adapter.psr6',
445+
'provider' => 'app.my_cache_chain_adapter',
437446
],
438447
'cache.my_redis' => [
439448
'adapter' => 'cache.adapter.redis',
440449
'provider' => 'redis://user:[email protected]',
441450
],
451+
'cache.apcu' => [
452+
'adapter' => 'cache.adapter.apcu',
453+
],
454+
'cache.array' => [
455+
'adapter' => 'cache.adapter.array',
456+
],
442457
],
443458
],
444459
]);
445460
446461
$container->getDefinition('app.my_cache_chain_adapter', \Symfony\Component\Cache\Adapter\ChainAdapter::class)
447462
->addArgument([
448-
new Reference('cache.adapter.array'),
463+
new Reference('cache.array'),
464+
new Reference('cache.apcu'),
449465
new Reference('cache.my_redis'),
450-
new Reference('cache.adapter.file'),
451466
])
452467
->addArgument(31536000);
453468
454469
.. note::
455470

456-
In this configuration there is a ``cache.my_redis`` pool that is used as an
457-
adapter in the ``app.my_cache_chain_adapter``
471+
In this configuration the ``my_cache_pool`` pool is using the ``cache.adapter.psr6``
472+
adapter and the ``app.my_cache_chain_adapter`` service as a provider. That is
473+
because ``ChainAdapter`` does not support the ``cache.pool`` tag. So it is decorated
474+
with the ``ProxyAdapter``.
458475

459476

460477
Using Cache Tags

form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,6 @@ the relationship between the removed ``Tag`` and ``Task`` object.
710710
elements of the collection. More advanced functionality like moving or duplicating
711711
an element in the collection and customizing the buttons is also possible.
712712

713-
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
713+
.. _`Owning Side and Inverse Side`: https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/unitofwork-associations.html
714714
.. _`JSFiddle`: http://jsfiddle.net/847Kf/4/
715715
.. _`symfony-collection`: https://github.com/ninsuo/symfony-collection

service_container/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ use this, update the compiler::
434434
foreach ($tags as $attributes) {
435435
$definition->addMethodCall('addTransport', [
436436
new Reference($id),
437-
$attributes["alias"]
437+
$attributes['alias']
438438
]);
439439
}
440440
}

0 commit comments

Comments
 (0)