This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml
Jeremy Mikola 7eea4882db [HttpKernel] Move request-stashing behavior to the Kernel class
Previously, HttpKernel performed request-stashing.  By moving this to the Kernel class, the request is now available immediately after the kernel becomes aware of it.  If the kernel is allowed to boot lazily (during the first call to handle()), this also allows an actual master Request to be available during booting.

The old "request" service definition (with a bogus class name) can be replaced with a factory-aware definition that retrieves the request directly from the kernel.
2010-12-09 09:38:17 +01:00

45 lines
2.0 KiB
XML

<?xml version="1.0" ?>
<container xmlns="http://www.symfony-project.org/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="event_dispatcher.class">Symfony\Bundle\FrameworkBundle\EventDispatcher</parameter>
<parameter key="http_kernel.class">Symfony\Component\HttpKernel\HttpKernel</parameter>
<parameter key="response.class">Symfony\Component\HttpFoundation\Response</parameter>
<parameter key="error_handler.class">Symfony\Component\HttpKernel\Debug\ErrorHandler</parameter>
<parameter key="error_handler.level">null</parameter>
</parameters>
<services>
<service id="event_dispatcher" class="%event_dispatcher.class%">
<call method="setContainer">
<argument type="service" id="service_container" />
</call>
</service>
<service id="error_handler" class="%error_handler.class%">
<argument>%error_handler.level%</argument>
</service>
<service id="http_kernel" class="%http_kernel.class%">
<argument type="service" id="service_container" />
<argument type="service" id="event_dispatcher" />
<argument type="service" id="controller_resolver" />
</service>
<!--
The request service is overwritten by the HttpKernel::handle() method,
this is just present to let the DI Container compile without errors.
If you want to use another Request class, you should modify the code in
your front controller (app.php) so that it passes an instance of
YourRequestClass to the Kernel.
-->
<service id="request" factory-service="kernel" factory-method="getRequest" shared="false" />
<service id="response" class="%response.class%" shared="false" />
</services>
</container>