Skip to content

Commit 1483ad1

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [Cache] Fixed a minor RST syntax issue [Cache] Expand the docs about the cache chain Explain the prefix used for expressions in YAML files Minor tweak in a security expression explanation
2 parents 410acb6 + 0635d10 commit 1483ad1

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

Diff for: cache.rst

+16-6
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,21 @@ and use that when configuring the pool.
374374
Creating a Cache Chain
375375
----------------------
376376

377-
Different cache adapters have different strengths and weaknesses. Some might be really
378-
quick but small and some may be able to contain a lot of data but are quite slow.
379-
To get the best of both worlds you may use a chain of adapters. The idea is to
380-
first look at the quick adapter and then move on to slower adapters. In the worst
381-
case the value needs to be recalculated.
377+
Different cache adapters have different strengths and weaknesses. Some might be
378+
really quick but optimized to store small items and some may be able to contain
379+
a lot of data but are quite slow. To get the best of both worlds you may use a
380+
chain of adapters.
381+
382+
A cache chain combines several cache pools into a single one. When storing an
383+
item in a cache chain, Symfony stores it in all pools sequentially. When
384+
retrieving an item, Symfony tries to get it from the first pool. If it's not
385+
found, it tries the next pools until the item is found or an exception is thrown.
386+
Because of this behavior, it's recommended to define the adapters in the chain
387+
in order from the fastest to the slowest.
388+
389+
If an error happens when storing an item in a pool, Symfony stores it in the
390+
other pools and no exception is thrown. Later, when the item is retrieved,
391+
Symfony stores the item automatically in all the missing pools.
382392

383393
.. versionadded:: 4.4
384394

@@ -478,7 +488,7 @@ the same key could be invalidate with one function call::
478488
}
479489
}
480490

481-
The cache adapter needs to implement :class:`Symfony\\Contracts\\Cache\\TagAwareCacheInterface``
491+
The cache adapter needs to implement :class:`Symfony\\Contracts\\Cache\\TagAwareCacheInterface`
482492
to enable this feature. This could be added by using the following configuration.
483493

484494
.. configuration-block::

Diff for: security/expressions.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Inside the expression, you have access to a number of variables:
3939
``user``
4040
The user object (or the string ``anon`` if you're not authenticated).
4141
``roles``
42-
The array of roles the user has, including from the
43-
:ref:`role hierarchy <security-role-hierarchy>` but not including the
44-
``IS_AUTHENTICATED_*`` attributes (see the functions below).
42+
The array of roles the user has. This array includes any roles granted
43+
indirectly via the :ref:`role hierarchy <security-role-hierarchy>` but it
44+
does not include the ``IS_AUTHENTICATED_*`` attributes (see the functions below).
4545
``object``
4646
The object (if any) that's passed as the second argument to ``isGranted()``.
4747
``token``

Diff for: service_container/expression_language.rst

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
2828
App\Mail\MailerConfiguration: ~
2929
3030
App\Mailer:
31+
# the '@=' prefix is required when using expressions for arguments in YAML files
3132
arguments: ['@=service("App\\Mail\\MailerConfiguration").getMailerMethod()']
3233
# when using double-quoted strings, the backslash needs to be escaped twice (see https://yaml.org/spec/1.2/spec.html#id2787109)
3334
# arguments: ["@=service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()"]
@@ -89,6 +90,7 @@ via a ``container`` variable. Here's another example:
8990
# config/services.yaml
9091
services:
9192
App\Mailer:
93+
# the '@=' prefix is required when using expressions for arguments in YAML files
9294
arguments: ["@=container.hasParameter('some_param') ? parameter('some_param') : 'default_value'"]
9395
9496
.. code-block:: xml

0 commit comments

Comments
 (0)