Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

some tweaks to the Expression Language cache chapter#3300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletionscomponents/expression_language/caching.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,14 +13,15 @@ compiled/evaluated quicker.
The Workflow
------------

Both ``evaluate`` and ``compile`` need to do some things before each can
provide the return values. For ``evaluate``, this overhead is even bigger.
Both :method:`Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage::evaluate`
and ``compile()`` need to do some things before each can provide the return
values. For ``evaluate()``, this overhead is even bigger.

Both methods need to tokenize and parse the expression. This is done by the
Both methods need to tokenize and parse the expression. This is done by the
:method:`Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage::parse`
method. It returns a :class:`Symfony\\Component\\ExpressionLanguage\\ParsedExpression`.
Now, the ``compile`` method just returns the string conversion of this object.
The ``evaluate`` method needs to loop through the "nodes" (pieces of an
Now, the ``compile()`` method just returns the string conversion of this object.
The ``evaluate()`` method needs to loop through the "nodes" (pieces of an
expression saved in the ``ParsedExpression``) and evaluate them on the fly.

To save time, the ``ExpressionLanguage`` caches the ``ParsedExpression`` so
Expand All@@ -40,14 +41,14 @@ in the object using the constructor::

.. note::

The `DoctrineBridge`_has aParserCache implementation using the
The `DoctrineBridge`_provides aParser Cache implementation using the
`doctrine cache library`_, which gives you caching for all sorts of cache
strategies, like Apc, Filesystem andApc.
strategies, like Apc, Filesystem andMemcached.

Using Parsed and Serialized Expressions
---------------------------------------

Both ``evaluate`` and ``compile`` can handle ``ParsedExpression`` and
Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
``SerializedParsedExpression``::

use Symfony\Component\ExpressionLanguage\ParsedExpression;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp