You are here

public function Kernel::__construct in Zircon Profile 8.0

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

Constructor.

Parameters

string $environment The environment:

bool $debug Whether to enable debugging or not:

1 call to Kernel::__construct()
Kernel::unserialize in vendor/symfony/http-kernel/Kernel.php

File

vendor/symfony/http-kernel/Kernel.php, line 77

Class

Kernel
The Kernel is the heart of the Symfony system.

Namespace

Symfony\Component\HttpKernel

Code

public function __construct($environment, $debug) {
  $this->environment = $environment;
  $this->debug = (bool) $debug;
  $this->rootDir = $this
    ->getRootDir();
  $this->name = $this
    ->getName();
  if ($this->debug) {
    $this->startTime = microtime(true);
  }
  $defClass = new \ReflectionMethod($this, 'init');
  $defClass = $defClass
    ->getDeclaringClass()->name;
  if (__CLASS__ !== $defClass) {
    @trigger_error(sprintf('Calling the %s::init() method is deprecated since version 2.3 and will be removed in 3.0. Move your logic to the constructor method instead.', $defClass), E_USER_DEPRECATED);
    $this
      ->init();
  }
}