Skip to content

Commit 31939d5

Browse files
committed
[#7064] Added versionadded and slightly changed the text
1 parent f60669f commit 31939d5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

components/expression_language/caching.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,24 @@ The ``evaluate()`` method needs to loop through the "nodes" (pieces of an
2525
expression saved in the ``ParsedExpression``) and evaluate them on the fly.
2626

2727
To save time, the ``ExpressionLanguage`` caches the ``ParsedExpression`` so
28-
it can skip the tokenize and parse steps with duplicate expressions.
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
32-
in the object using the constructor::
28+
it can skip the tokenize and parse steps with duplicate expressions. The
29+
caching is done by a PSR-6 `CacheItemPoolInterface`_ instance (by default, it
30+
uses an :class:`Symfony\\Component\\Cache\\Adapter\\ArrayAdapter`). You can
31+
customize this by creating a custom cache pool or using one of the available
32+
ones and injecting this using the constructor::
3333

3434
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
3535
use Symfony\Component\Cache\Adapter\RedisAdapter;
3636

3737
$cache = new RedisAdapter(...);
3838
$language = new ExpressionLanguage($cache);
3939

40+
.. versionadded:: 3.2
41+
PSR-6 caching support was introduced in Symfony 3.2. Prior to version 3.2,
42+
a
43+
:class:`Symfony\\Component\\ExpressionLanguage\\ParserCache\\ParserCacheInterface`
44+
instance had to be injected.
45+
4046
.. seealso::
4147

4248
See the :doc:`/components/cache` documentation for more information about

0 commit comments

Comments
 (0)