You are here

public function ContainerAwareHttpKernel::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php \Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel::__construct()

Constructor.

Parameters

EventDispatcherInterface $dispatcher An EventDispatcherInterface instance:

ContainerInterface $container A ContainerInterface instance:

ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance:

RequestStack $requestStack A stack for master/sub requests:

bool $triggerDeprecation Whether or not to trigger the deprecation warning for the ContainerAwareHttpKernel:

Overrides HttpKernel::__construct

File

vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php, line 44

Class

ContainerAwareHttpKernel
Adds a managed request scope.

Namespace

Symfony\Component\HttpKernel\DependencyInjection

Code

public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null, $triggerDeprecation = true) {
  parent::__construct($dispatcher, $controllerResolver, $requestStack);
  if ($triggerDeprecation) {
    @trigger_error('The ' . __CLASS__ . ' class is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\\Component\\HttpKernel\\HttpKernel class instead.', E_USER_DEPRECATED);
  }
  $this->container = $container;

  // the request scope might have been created before (see FrameworkBundle)
  if (!$container
    ->hasScope('request')) {
    $container
      ->addScope(new Scope('request'));
  }
}