8000 Merge branch '3.4' into 4.2 · symfony/symfony-docs@7d89756 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d89756

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Update fortrabbit.rst Document the kernel.reset 8000 tag
2 parents 07f0cd4 + 9c537a7 commit 7d89756

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

reference/dic_tags.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Tag Name Usage
2525
`kernel.event_listener`_ Listen to different events/hooks in Symfony
2626
`kernel.event_subscriber`_ To subscribe to a set of different events/hooks in Symfony
2727
`kernel.fragment_renderer`_ Add new HTTP content rendering strategies
28+
`kernel.reset`_ Allows to clean up services between requests
2829
`monolog.logger`_ Logging with a custom logging channel
2930
`monolog.processor`_ Add a custom processor for logging
3031
`routing.loader`_ Register a custom service that loads routes
@@ -450,6 +451,21 @@ To add a new rendering strategy - in addition to the core strategies like
450451
:class:`Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface`,
451452
register it as a service, then tag it with ``kernel.fragment_renderer``.
452453

454+
kernel.reset
455+
------------
456+
457+
**Purpose**: Clean up services between requests
458+
459+
During the ``kernel.terminate`` event, Symfony looks for any service tagged
460+
with the ``kernel.reset`` tag to reinitialize their state. This is done by
461+
calling to the method whose name is configured in the ``method`` argument of
462+
the tag.
463+
464+
This is mostly useful when running your projects in application servers that
465+
reuse the Symfony application between requests to improve performance. This tag
466+
is applied for example to the built-in :doc:`data collectors </profiler/data_collector>`
467+
of the profiler to delete all their information.
468+
453469
.. _dic_tags-monolog:
454470

455471
monolog.logger

0 commit comments

Comments
 (0)
0