@@ -26,24 +26,21 @@ expression saved in the ``ParsedExpression``) and evaluate them on the fly.
26
26
27
27
To save time, the ``ExpressionLanguage `` caches the ``ParsedExpression `` so
28
28
it 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
34
32
in the object using the constructor::
35
33
36
34
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
37
- use Acme\ExpressionLanguage\ParserCache\MyDatabaseParserCache ;
35
+ use Symfony\Component\Cache\Adapter\RedisAdapter ;
38
36
39
- $cache = new MyDatabaseParserCache (...);
37
+ $cache = new RedisAdapter (...);
40
38
$language = new ExpressionLanguage($cache);
41
39
42
- .. note ::
40
+ .. seealso ::
43
41
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.
47
44
48
45
Using Parsed and Serialized Expressions
49
46
---------------------------------------
@@ -70,5 +67,4 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
70
67
71
68
var_dump($language->evaluate($expression)); // prints 5
72
69
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