moved the request scope creation to the ContainerAwareHttpKernel class
This commit is contained in:
parent
77ec799751
commit
550df5a85a
@ -28,7 +28,6 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumpe
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FragmentRendererPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||
use Symfony\Component\DependencyInjection\Scope;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
@ -56,8 +55,6 @@ class FrameworkBundle extends Bundle
|
||||
{
|
||||
parent::build($container);
|
||||
|
||||
$container->addScope(new Scope('request'));
|
||||
|
||||
$container->addCompilerPass(new RoutingResolverPass());
|
||||
$container->addCompilerPass(new ProfilerPass());
|
||||
$container->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING);
|
||||
|
@ -18,9 +18,10 @@ use Symfony\Component\HttpKernel\HttpKernel;
|
||||
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Scope;
|
||||
|
||||
/**
|
||||
* This HttpKernel is used to manage scope changes of the DI container.
|
||||
* Adds a managed request scope.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
||||
@ -41,6 +42,7 @@ class ContainerAwareHttpKernel extends HttpKernel
|
||||
parent::__construct($dispatcher, $controllerResolver);
|
||||
|
||||
$this->container = $container;
|
||||
$container->addScope(new Scope('request'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user