Skip to content

Commit c14e165

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: [Cache] Make sure the chain cache configuration works Fix broken link to doctrine documentation Use single quotes for example code
2 parents cc1d47e + 49a29de commit c14e165

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

cache.rst

+27-10
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,22 @@ case the value needs to be recalculated.
389389
cache:
390390
pools:
391391
my_cache_pool:
392-
adapter: app.my_cache_chain_adapter
392+
adapter: cache.adapter.psr6
393+
provider: app.my_cache_chain_adapter
393394
cache.my_redis:
394395
adapter: cache.adapter.redis
395396
provider: 'redis://user:password@example.com'
397+
cache.apcu:
398+
adapter: cache.adapter.apcu
399+
cache.array:
400+
adapter: cache.adapter.array
401+
396402
397403
services:
398404
app.my_cache_chain_adapter:
399405
class: Symfony\Component\Cache\Adapter\ChainAdapter
400406
arguments:
401-
- ['cache.adapter.array', 'cache.my_redis', 'cache.adapter.file']
407+
- ['@cache.array', '@cache.apcu', '@cache.my_redis']
402408
- 31536000 # One year
403409
404410
.. code-block:: xml
@@ -413,17 +419,19 @@ case the value needs to be recalculated.
413419
414420
<framework:config>
415421
<framework:cache>
416-
<framework:pool name="my_cache_pool" adapter="app.my_cache_chain_adapter"/>
422+
<framework:pool name="my_cache_pool" adapter="cache.adapter.psr6" provider="app.my_cache_chain_adapter"/>
417423
<framework:pool name="cache.my_redis" adapter="cache.adapter.redis" provider="redis://user:password@example.com"/>
424+
<framework:pool name="cache.apcu" adapter="cache.adapter.apcu"/>
425+
<framework:pool name="cache.array" adapter="cache.adapter.array"/>
418426
</framework:cache>
419427
</framework:config>
420428
421429
<services>
422430
<service id="app.my_cache_chain_adapter" class="Symfony\Component\Cache\Adapter\ChainAdapter">
423431
<argument type="collection">
424-
<argument type="service" value="cache.adapter.array"/>
432+
<argument type="service" value="cache.array"/>
433+
<argument type="service" value="cache.apcu"/>
425434
<argument type="service" value="cache.my_redis"/>
426-
<argument type="service" value="cache.adapter.file"/>
427435
</argument>
428436
<argument>31536000</argument>
429437
</service>
@@ -437,28 +445,37 @@ case the value needs to be recalculated.
437445
'cache' => [
438446
'pools' => [
439447
'my_cache_pool' => [
440-
'adapter' => 'app.my_cache_chain_adapter',
448+
'adapter' => 'cache.adapter.psr6',
449+
'provider' => 'app.my_cache_chain_adapter',
441450
],
442451
'cache.my_redis' => [
443452
'adapter' => 'cache.adapter.redis',
444453
'provider' => 'redis://user:password@example.com',
445454
],
455+
'cache.apcu' => [
456+
'adapter' => 'cache.adapter.apcu',
457+
],
458+
'cache.array' => [
459+
'adapter' => 'cache.adapter.array',
460+
],
446461
],
447462
],
448463
]);
449464
450465
$container->getDefinition('app.my_cache_chain_adapter', \Symfony\Component\Cache\Adapter\ChainAdapter::class)
451466
->addArgument([
452-
new Reference('cache.adapter.array'),
467+
new Reference('cache.array'),
468+
new Reference('cache.apcu'),
453469
new Reference('cache.my_redis'),
454-
new Reference('cache.adapter.file'),
455470
])
456471
->addArgument(31536000);
457472
458473
.. note::
459474

460-
In this configuration there is a ``cache.my_redis`` pool that is used as an
461-
adapter in the ``app.my_cache_chain_adapter``
475+
In this configuration the ``my_cache_pool`` pool is using the ``cache.adapter.psr6``
476+
adapter and the ``app.my_cache_chain_adapter`` service as a provider. That is
477+
because ``ChainAdapter`` does not support the ``cache.pool`` tag. So it is decorated
478+
with the ``ProxyAdapter``.
462479

463480

464481
Using Cache Tags

form/form_collections.rst

+1-1
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

+1-1
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)