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

Appearance settings

Commit 7d89756

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

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed

‎reference/dic_tags.rst

Copy file name to clipboardExpand all lines: reference/dic_tags.rst
+16Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.