Symfony\Component\HttpKernel\Kernel::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string $environment, boolean $debug )
$environment string The environment
$debug boolean Whether to enable debugging or not
    public function __construct($environment, $debug)
    {
        $this->environment = $environment;
        $this->debug = (Boolean) $debug;
        $this->booted = false;
        $this->rootDir = realpath($this->registerRootDir());
        $this->name = basename($this->rootDir);

        if ($this->debug) {
            ini_set('display_errors', 1);
            error_reporting(-1);

            $this->startTime = microtime(true);
        } else {
            ini_set('display_errors', 0);
        }
    }

Usage Example

Beispiel #1
0
 public function __construct($environment, $debug)
 {
     // Two is better than one...
     //ini_set("date.timezone", "UTC");
     date_default_timezone_set('UTC');
     parent::__construct($environment, $debug);
 }
All Usage Examples Of Symfony\Component\HttpKernel\Kernel::__construct