Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 550df5a

Browse files
committed
moved the request scope creation to the ContainerAwareHttpKernel class
1 parent 77ec799 commit 550df5a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FragmentRendererPass;
2929
use Symfony\Component\DependencyInjection\ContainerBuilder;
3030
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
31-
use Symfony\Component\DependencyInjection\Scope;
3231
use Symfony\Component\HttpFoundation\Request;
3332
use Symfony\Component\HttpKernel\Bundle\Bundle;
3433

@@ -56,8 +55,6 @@ public function build(ContainerBuilder $container)
5655
{
5756
parent::build($container);
5857

59-
$container->addScope(new Scope('request'));
60-
6158
$container->addCompilerPass(new RoutingResolverPass());
6259
$container->addCompilerPass(new ProfilerPass());
6360
$container->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING);

src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
1919
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2020
use Symfony\Component\DependencyInjection\ContainerInterface;
21+
use Symfony\Component\DependencyInjection\Scope;
2122

2223
/**
23-
* This HttpKernel is used to manage scope changes of the DI container.
24+
* Adds a managed request scope.
2425
*
2526
* @author Fabien Potencier <[email protected]>
2627
* @author Johannes M. Schmitt <[email protected]>
@@ -41,6 +42,7 @@ public function __construct(EventDispatcherInterface $dispatcher, ContainerInter
4142
parent::__construct($dispatcher, $controllerResolver);
4243

4344
$this->container = $container;
45+
$container->addScope(new Scope('request'));
4446
}
4547

4648
/**

0 commit comments

Comments
 (0)