Skip to content

Commit f60669f

Browse files
committed
feature #7064 Update caching.rst (ReDnAxE)
This PR was merged into the master branch. Discussion ---------- Update caching.rst Updating doc for this PR Making cache PSR6 compliant : [#19741](symfony/symfony#19741) Commits ------- f03f2f3 Update caching.rst
2 parents 2083d9d + f03f2f3 commit f60669f

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

components/expression_language/caching.rst

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,21 @@ expression saved in the ``ParsedExpression``) and evaluate them on the fly.
2626

2727
To save time, the ``ExpressionLanguage`` caches the ``ParsedExpression`` so
2828
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
3432
in 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

4845
Using 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

Comments
 (0)