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