@@ -26,24 +26,21 @@ expression saved in the ``ParsedExpression``) and evaluate them on the fly.
2626
2727To save time, the ``ExpressionLanguage `` caches the ``ParsedExpression `` so
2828it can skip the tokenize and parse steps with duplicate expressions.
29- The caching is done by a
30- :class: `Symfony\\ Component\\ ExpressionLanguage\\ ParserCache\\ ParserCacheInterface `
31- instance (by default, it uses an
32- :class: `Symfony\\ Component\\ ExpressionLanguage\\ ParserCache\\ ArrayParserCache `).
33- You can customize this by creating a custom ``ParserCache `` and injecting this
29+ The caching is done by a `CacheItemPoolInterface `_ instance (by default, it uses an
30+ :class: `Symfony\\ Component\\ Cache\\ Adapter\\ ArrayAdapter `).
31+ You can customize this by creating a custom ``Cache `` and injecting this
3432in the object using the constructor::
3533
3634 use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
37- use Acme\ExpressionLanguage\ParserCache\MyDatabaseParserCache ;
35+ use Symfony\Component\Cache\Adapter\RedisAdapter ;
3836
39- $cache = new MyDatabaseParserCache (...);
37+ $cache = new RedisAdapter (...);
4038 $language = new ExpressionLanguage($cache);
4139
42- .. note ::
40+ .. seealso ::
4341
44- The `DoctrineBridge `_ provides a Parser Cache implementation using the
45- `doctrine cache library `_, which gives you caching for all sorts of cache
46- strategies, like Apc, Filesystem and Memcached.
42+ See the :doc: `/components/cache ` documentation for more information about
43+ available cache adapters.
4744
4845Using Parsed and Serialized Expressions
4946---------------------------------------
@@ -70,5 +67,4 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
7067
7168 var_dump($language->evaluate($expression)); // prints 5
7269
73- .. _DoctrineBridge : https://github.com/symfony/doctrine-bridge
74- .. _`doctrine cache library` : http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/caching.html
70+ .. _`CacheItemPoolInterface` : https://github.com/php-fig/cache/blob/master/src/CacheItemPoolInterface.php
0 commit comments