diff --git a/README.md b/README.md index 77021be..0ff443a 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,30 @@ twig_cache: service: cache_service # instance of Doctrine\Common\Cache\Cache ``` +Another option is to configure one of the PSR-6 Cache pool implementations +by changing the default adapter class to the `PsrCacheAdapter`. + +```yml +# parameters.yml +twig_cache.adapter.class: Asm89\Twig\CacheExtension\CacheProvider\PsrCacheAdapter +``` + +After that any cache pool that implements the `CacheItemPoolInterface` is +supported. The [`CacheBundle`](https://github.com/php-cache/cache-bundle) will +allow you to configure the cache pool of your choice. List of predefined pools +can be found at: [http://php-cache.readthedocs.io/](http://php-cache.readthedocs.io/) + +```yml +# config.yml +cache_adapter: + providers: + twig_apcu: + factory: 'cache.factory.apcu' + +twig_cache: + service: cache.provider.twig_apcu +``` + Usage ----- diff --git a/composer.json b/composer.json index f4d965a..50050e5 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "asm89/twig-cache-extension": "^1.0" + "asm89/twig-cache-extension": "^1.3" }, "require-dev": { "doctrine/cache": "^1.4", @@ -38,6 +38,8 @@ } }, "suggest": { - "itinance/doctrine-cache-adapter-with-site-context": "a Cache Adapter used to respect the current site context in a white-label/multi-site environment" + "itinance/doctrine-cache-adapter-with-site-context": "a Cache Adapter used to respect the current site context in a white-label/multi-site environment", + "cache/adapter-bundle": "To make use of PSR-6 cache implementation via PsrCacheAdapter.", + "cache/cache-bundle": "To easily be able to configure adapters in your Symfony application." } }