@@ -65,7 +65,9 @@ adapter (template) they use by using the ``app`` and ``system`` key like:
6565 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6666 xmlns : framework =" http://symfony.com/schema/dic/symfony"
6767 xsi : schemaLocation =" http://symfony.com/schema/dic/services
68- https://symfony.com/schema/dic/services/services-1.0.xsd" >
68+ https://symfony.com/schema/dic/services/services-1.0.xsd
69+ http://symfony.com/schema/dic/symfony
70+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
6971
7072 <framework : config >
7173 <framework : cache app =" cache.adapter.filesystem"
@@ -133,7 +135,9 @@ will create pool with service id of ``cache.[type]``
133135 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
134136 xmlns : framework =" http://symfony.com/schema/dic/symfony"
135137 xsi : schemaLocation =" http://symfony.com/schema/dic/services
136- https://symfony.com/schema/dic/services/services-1.0.xsd" >
138+ https://symfony.com/schema/dic/services/services-1.0.xsd
139+ http://symfony.com/schema/dic/symfony
140+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
137141
138142 <framework : config >
139143 <!--
@@ -143,6 +147,7 @@ will create pool with service id of ``cache.[type]``
143147 default_memcached_provider: Service: cache.memcached
144148 default_pdo_provider: Service: cache.pdo
145149 -->
150+ <!-- "directory" attribute is only used with cache.adapter.filesystem -->
146151 <framework : cache directory =" %kernel.cache_dir%/pools"
147152 default_doctrine_provider =" app.doctrine_cache"
148153 default_psr6_provider =" app.my_psr6_service"
@@ -204,7 +209,9 @@ You can also create more customized pools. All you need is an adapter:
204209 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
205210 xmlns : framework =" http://symfony.com/schema/dic/symfony"
206211 xsi : schemaLocation =" http://symfony.com/schema/dic/services
207- https://symfony.com/schema/dic/services/services-1.0.xsd" >
212+ https://symfony.com/schema/dic/services/services-1.0.xsd
213+ http://symfony.com/schema/dic/symfony
214+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
208215
209216 <framework : config >
210217 <framework : cache default_memcached_provider =" memcached://localhost" >
@@ -276,7 +283,9 @@ For advanced configurations it could sometimes be useful to use a pool as an ada
276283 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
277284 xmlns : framework =" http://symfony.com/schema/dic/symfony"
278285 xsi : schemaLocation =" http://symfony.com/schema/dic/services
279- https://symfony.com/schema/dic/services/services-1.0.xsd" >
286+ https://symfony.com/schema/dic/services/services-1.0.xsd
287+ http://symfony.com/schema/dic/symfony
288+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
280289
281290 <framework : config >
282291 <framework : cache app =" my_cache_pool" >
@@ -354,7 +363,9 @@ and use that when configuring the pool.
354363 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
355364 xmlns : framework =" http://symfony.com/schema/dic/symfony"
356365 xsi : schemaLocation =" http://symfony.com/schema/dic/services
357- https://symfony.com/schema/dic/services/services-1.0.xsd" >
366+ https://symfony.com/schema/dic/services/services-1.0.xsd
367+ http://symfony.com/schema/dic/symfony
368+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
358369
359370 <framework : config >
360371 <framework : cache >
@@ -364,6 +375,7 @@ and use that when configuring the pool.
364375
365376 <services >
366377 <service id =" app.my_custom_redis_provider" class =" \Redis" >
378+ <factory class =" Symfony\Component\Cache\Adapter\RedisAdapter" method =" createConnection" />
367379 <argument >redis://localhost</argument >
368380 <argument type =" collection" >
369381 <argument key =" retry_interval" >2</argument >
@@ -376,6 +388,8 @@ and use that when configuring the pool.
376388 .. code-block :: php
377389
378390 // app/config/config.php
391+ use Symfony\Component\Cache\Adapter\RedisAdapter;
392+
379393 $container->loadFromExtension('framework', [
380394 'cache' => [
381395 'pools' => [
@@ -387,12 +401,14 @@ and use that when configuring the pool.
387401 ],
388402 ]);
389403
390- $container->getDefinition('app.my_custom_redis_provider', \Redis::class)
404+ $container->register('app.my_custom_redis_provider', \Redis::class)
405+ ->setFactory([RedisAdapter::class, 'createConnection'])
391406 ->addArgument('redis://localhost')
392407 ->addArgument([
393408 'retry_interval' => 2,
394409 'timeout' => 10
395- ]);
410+ ])
411+ ;
396412
397413 Creating a Cache Chain
398414----------------------
@@ -448,7 +464,9 @@ Symfony stores the item automatically in all the missing pools.
448464 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
449465 xmlns : framework =" http://symfony.com/schema/dic/symfony"
450466 xsi : schemaLocation =" http://symfony.com/schema/dic/services
451- https://symfony.com/schema/dic/services/services-1.0.xsd" >
467+ https://symfony.com/schema/dic/services/services-1.0.xsd
468+ http://symfony.com/schema/dic/symfony
469+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
452470
453471 <framework : config >
454472 <framework : cache >
@@ -474,6 +492,9 @@ Symfony stores the item automatically in all the missing pools.
474492 .. code-block :: php
475493
476494 // app/config/config.php
495+ use Symfony\Component\Cache\Adapter\ChainAdapter;
496+ use Symfony\Component\DependencyInjection\Reference;
497+
477498 $container->loadFromExtension('framework', [
478499 'cache' => [
479500 'pools' => [
@@ -495,13 +516,14 @@ Symfony stores the item automatically in all the missing pools.
495516 ],
496517 ]);
497518
498- $container->getDefinition ('app.my_cache_chain_adapter', \Symfony\Component\Cache\Adapter\ ChainAdapter::class)
519+ $container->register ('app.my_cache_chain_adapter', ChainAdapter::class)
499520 ->addArgument([
500521 new Reference('cache.array'),
501522 new Reference('cache.apcu'),
502523 new Reference('cache.my_redis'),
503524 ])
504- ->addArgument(31536000);
525+ ->addArgument(31536000)
526+ ;
505527
506528 .. note ::
507529
0 commit comments