@@ -78,10 +78,11 @@ adapter (template) they use by using the ``app`` and ``system`` key like:
7878 xsi : schemaLocation =" http://symfony.com/schema/dic/services
7979 https://symfony.com/schema/dic/services/services-1.0.xsd
8080 http://symfony.com/schema/dic/symfony
81- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
82-
81+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
82+ >
8383 <framework : config >
84- <framework : cache app =" cache.adapter.filesystem"
84+ <framework : cache
85+ app =" cache.adapter.filesystem"
8586 system =" cache.adapter.system"
8687 />
8788 </framework : config >
@@ -99,7 +100,6 @@ adapter (template) they use by using the ``app`` and ``system`` key like:
99100 ;
100101 };
101102
102-
103103 The Cache component comes with a series of adapters pre-configured:
104104
105105* :doc: `cache.adapter.apcu </components/cache/adapters/apcu_adapter >`
@@ -149,8 +149,8 @@ will create pools with service IDs that follow the pattern ``cache.[type]``.
149149 xsi : schemaLocation =" http://symfony.com/schema/dic/services
150150 https://symfony.com/schema/dic/services/services-1.0.xsd
151151 http://symfony.com/schema/dic/symfony
152- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
153-
152+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
153+ >
154154 <framework : config >
155155 <!--
156156 default_doctrine_provider: Service: cache.doctrine
@@ -250,8 +250,8 @@ You can also create more customized pools:
250250 xsi : schemaLocation =" http://symfony.com/schema/dic/services
251251 https://symfony.com/schema/dic/services/services-1.0.xsd
252252 http://symfony.com/schema/dic/symfony
253- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
254-
253+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
254+ >
255255 <framework : config >
256256 <framework : cache default-memcached-provider =" memcached://localhost" >
257257 <!-- creates a "custom_thing.cache" service
@@ -352,6 +352,8 @@ with either :class:`Symfony\\Contracts\\Cache\\CacheInterface` or
352352
353353 # config/services.yaml
354354 services :
355+ # ...
356+
355357 app.cache.adapter.redis :
356358 parent : ' cache.adapter.redis'
357359 tags :
@@ -364,9 +366,11 @@ with either :class:`Symfony\\Contracts\\Cache\\CacheInterface` or
364366 <container xmlns =" http://symfony.com/schema/dic/services"
365367 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
366368 xsi : schemaLocation =" http://symfony.com/schema/dic/services
367- https://symfony.com/schema/dic/services/services-1.0.xsd" >
368-
369+ https://symfony.com/schema/dic/services/services-1.0.xsd"
370+ >
369371 <services >
372+ <!-- ... -->
373+
370374 <service id =" app.cache.adapter.redis" parent =" cache.adapter.redis" >
371375 <tag name =" cache.pool" namespace =" my_custom_namespace" />
372376 </service >
@@ -378,12 +382,14 @@ with either :class:`Symfony\\Contracts\\Cache\\CacheInterface` or
378382 // config/services.php
379383 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
380384
381- return function(ContainerConfigurator $configurator) {
382- $services = $configurator->services();
385+ return function(ContainerConfigurator $container) {
386+ $container->services()
387+ // ...
383388
384- $services->set('app.cache.adapter.redis')
385- ->parent('cache.adapter.redis')
386- ->tag('cache.pool', ['namespace' => 'my_custom_namespace']);
389+ ->set('app.cache.adapter.redis')
390+ ->parent('cache.adapter.redis')
391+ ->tag('cache.pool', ['namespace' => 'my_custom_namespace'])
392+ ;
387393 };
388394
389395 Custom Provider Options
@@ -425,11 +431,14 @@ and use that when configuring the pool.
425431 xsi : schemaLocation =" http://symfony.com/schema/dic/services
426432 https://symfony.com/schema/dic/services/services-1.0.xsd
427433 http://symfony.com/schema/dic/symfony
428- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
429-
434+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
435+ >
430436 <framework : config >
431437 <framework : cache >
432- <framework : pool name =" cache.my_redis" adapter =" cache.adapter.redis" provider =" app.my_custom_redis_provider" />
438+ <framework : pool name =" cache.my_redis"
439+ adapter =" cache.adapter.redis"
440+ provider =" app.my_custom_redis_provider"
441+ />
433442 </framework : cache >
434443 </framework : config >
435444
@@ -448,6 +457,8 @@ and use that when configuring the pool.
448457 .. code-block :: php
449458
450459 // config/packages/cache.php
460+ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
461+
451462 use Symfony\Component\Cache\Adapter\RedisAdapter;
452463 use Symfony\Component\DependencyInjection\ContainerBuilder;
453464 use Symfony\Config\FrameworkConfig;
@@ -511,11 +522,14 @@ Symfony stores the item automatically in all the missing pools.
511522 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
512523 xmlns : framework =" http://symfony.com/schema/dic/symfony"
513524 xsi : schemaLocation =" http://symfony.com/schema/dic/services
514- https://symfony.com/schema/dic/services/services-1.0.xsd" >
515-
525+ https://symfony.com/schema/dic/services/services-1.0.xsd
526+ http://symfony.com/schema/dic/symfony
527+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
528+ >
516529 <framework : config >
517530 <framework : cache >
518- <framework : pool name =" my_cache_pool" default-lifetime =" 31536000" >
531+ <framework : pool name =" my_cache_pool"
532+ default-lifetime =" 31536000" > <!-- One year -->
519533 <framework : adapter name =" cache.adapter.array" />
520534 <framework : adapter name =" cache.adapter.apcu" />
521535 <framework : adapter name =" cache.adapter.redis" provider =" redis://user:password@example.com" />
@@ -606,11 +620,14 @@ to enable this feature. This could be added by using the following configuration
606620 xsi : schemaLocation =" http://symfony.com/schema/dic/services
607621 https://symfony.com/schema/dic/services/services-1.0.xsd
608622 http://symfony.com/schema/dic/symfony
609- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
610-
623+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
624+ >
611625 <framework : config >
612626 <framework : cache >
613- <framework : pool name =" my_cache_pool" adapter =" cache.adapter.redis" tags =" true" />
627+ <framework : pool name =" my_cache_pool"
628+ adapter =" cache.adapter.redis"
629+ tags =" true"
630+ />
614631 </framework : cache >
615632 </framework : config >
616633 </container >
@@ -654,12 +671,17 @@ achieved by specifying the adapter.
654671 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
655672 xmlns : framework =" http://symfony.com/schema/dic/symfony"
656673 xsi : schemaLocation =" http://symfony.com/schema/dic/services
657- https://symfony.com/schema/dic/services/services-1.0.xsd" >
658-
674+ https://symfony.com/schema/dic/services/services-1.0.xsd
675+ http://symfony.com/schema/dic/symfony
676+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
677+ >
659678 <framework : config >
660679 <framework : cache >
661- <framework : pool name =" my_cache_pool" adapter =" cache.adapter.redis" tags =" tag_pool" />
662- <framework : pool name =" tag_pool" adapter =" cache.adapter.apcu" />
680+ <framework : pool name =" my_cache_pool"
681+ adapter =" cache.adapter.redis"
682+ tags =" tag_pool"
683+ />
684+ <framework : pool name =" tag_pool" adapter =" cache.adapter.apcu" />
663685 </framework : cache >
664686 </framework : config >
665687 </container >
0 commit comments