Skip to content

Add container.hot_path to built-in service tags #12684

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all 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
22 changes: 22 additions & 0 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Tag Name Usage
`assetic.templating.twig`_ Remove this service if Twig templating is disabled
`auto_alias`_ Define aliases based on the value of container parameters
`console.command`_ Add a command
`container.hot_path`_ Add to list of always needed services
`controller.argument_value_resolver`_ Register a value resolver for controller arguments such as ``Request``
`data_collector`_ Create a class that collects custom data for the profiler
`doctrine.event_listener`_ Add a Doctrine event listener
Expand Down Expand Up @@ -362,6 +363,27 @@ console.command
For details on registering your own commands in the service container, read
:doc:`/console/commands_as_services`.

container.hot_path
------------------

.. versionadded:: 3.4

The ``container.hot_path`` tag was introduced in Symfony 3.4.

**Purpose**: Add to list of always needed services

This tag identifies the services that are always needed. It is only applied to
a very short list of bootstrapping services (like ``router``, ``event_dispatcher``,
``http_kernel``, ``request_stack``, etc.). Then, it is propagated to all dependencies
of these services, with a special case for event listeners, where only listed events
are propagated to their related listeners.

It will replace, in cache for generated service factories, the PHP autoload by
plain inlined ``include_once``. The benefit is a complete bypass of the autoloader
for services and their class hierarchy. The result is as significant performance improvement.

Use this tag with great caution, you have to be sure that the tagged service is always used.

controller.argument_value_resolver
----------------------------------

Expand Down