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 1647b9a

Browse filesBrowse files
committed
Add container.hot_path to built-in service tags
1 parent d9bd18f commit 1647b9a
Copy full SHA for 1647b9a

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+22
-0
lines changed

‎reference/dic_tags.rst

Copy file name to clipboardExpand all lines: reference/dic_tags.rst
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Tag Name Usage
2020
`assetic.templating.twig`_ Remove this service if Twig templating is disabled
2121
`auto_alias`_ Define aliases based on the value of container parameters
2222
`console.command`_ Add a command
23+
`container.hot_path`_ Add to list of always needed services
2324
`controller.argument_value_resolver`_ Register a value resolver for controller arguments such as ``Request``
2425
`data_collector`_ Create a class that collects custom data for the profiler
2526
`doctrine.event_listener`_ Add a Doctrine event listener
@@ -362,6 +363,27 @@ console.command
362363
For details on registering your own commands in the service container, read
363364
:doc:`/console/commands_as_services`.
364365

366+
container.hot_path
367+
------------------
368+
369+
.. versionadded:: 3.4
370+
371+
The ``container.hot_path`` tag was introduced in Symfony 3.4.
372+
373+
**Purpose**: Add to list of always needed services
374+
375+
This tag identifies the services that are always needed. It is only applied to
376+
a very short list of bootstrapping services (like ``router``, ``event_dispatcher``,
377+
``http_kernel``, ``request_stack``, etc.). Then, it is propagated to all dependencies
378+
of these services, with a special case for event listeners, where only listed events
379+
are propagated to their related listeners.
380+
381+
It will replace, in cache for generated service factories, the PHP autoload by
382+
plain inlined ``include_once``. The benefit is a complete bypass of the autoloader
383+
for services and their class hierarchy. The result is as significant performance improvement.
384+
385+
Use this tag with great caution, you have to be sure that the tagged service is always used.
386+
365387
controller.argument_value_resolver
366388
----------------------------------
367389

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.