@@ -202,7 +202,7 @@ You can also create more customized pools:
202
202
# creates a "my_cache_pool" service
203
203
# autowireable via "CacheInterface $myCachePool"
204
204
my_cache_pool :
205
- adapter : cache.adapter.array
205
+ adapter : cache.adapter.filesystem
206
206
207
207
# uses the default_memcached_provider from above
208
208
acme.cache :
@@ -240,7 +240,7 @@ You can also create more customized pools:
240
240
241
241
<!-- creates a "my_cache_pool" service
242
242
autowireable via "CacheInterface $myCachePool" -->
243
- <framework : pool name =" my_cache_pool" adapter =" cache.adapter.array " />
243
+ <framework : pool name =" my_cache_pool" adapter =" cache.adapter.filesystem " />
244
244
245
245
<!-- uses the default_memcached_provider from above -->
246
246
<framework : pool name =" acme.cache" adapter =" cache.adapter.memcached" />
@@ -274,14 +274,66 @@ You can also create more customized pools:
274
274
// creates a "my_cache_pool" service
275
275
// autowireable via "CacheInterface $myCachePool"
276
276
'my_cache_pool' => [
277
- 'adapter' => 'cache.adapter.array ',
277
+ 'adapter' => 'cache.adapter.filesystem ',
278
278
],
279
279
280
280
// uses the default_memcached_provider from above
281
281
'acme.cache' => [
282
282
'adapter' => 'cache.adapter.memcached',
283
283
],
284
284
285
+ 'cache.foobar' => [
286
+ 'adapter' => 'cache.adapter.memcached',
287
+ 'provider' => 'memcached://user:password@example.com',
288
+ ],
289
+ ],
290
+ ],
291
+ ]);
292
+
293
+ The configuration above will create 3 services: ``my_cache_pool ``, ``cache.acme ``
294
+ and ``cache.foobar ``. The ``my_cache_pool `` pool is using the filesystem adapter
295
+ and the other two are using the :doc: `MemcachedAdapter </components/cache/adapters/memcached_adapter >`.
296
+ The ``cache.acme `` pool is using the Memcached server on localhost and ``cache.foobar ``
297
+ is using the Memcached server at example.com.
298
+
299
+ For advanced configurations it could sometimes be useful to use a pool as an adapter.
300
+
301
+ .. configuration-block ::
302
+
303
+ .. code-block :: yaml
304
+
305
+ # app/config/config.yml
306
+ framework :
307
+ cache :
308
+ app : my_configured_app_cache
309
+ pools :
310
+ my_cache_pool :
311
+ adapter : cache.adapter.memcached
312
+ provider : ' memcached://user:password@example.com'
313
+ cache.short_cache :
314
+ adapter : my_cache_pool
315
+ default_lifetime : 60
316
+ cache.long_cache :
317
+ adapter : my_cache_pool
318
+ default_lifetime : 604800
319
+ my_configured_app_cache :
320
+ # "cache.adapter.filesystem" is the default for "cache.app"
321
+ adapter : cache.adapter.filesystem
322
+ default_lifetime : 3600
323
+
324
+ .. code-block :: xml
325
+
326
+ <!-- app/config/config.xml -->
327
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
328
+ <container xmlns =" http://symfony.com/schema/dic/services"
329
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
330
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
331
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
332
+ https://symfony.com/schema/dic/services/services-1.0.xsd
333
+ http://symfony.com/schema/dic/symfony
334
+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
335
+ >>>>>>> 3.4
336
+
285
337
// control adapter's configuration
286
338
'foobar.cache' => [
287
339
'adapter' => 'cache.adapter.memcached',
0 commit comments