public function __construct(array $values = [])
{
/** @internal Parameter to track a deprecated PHP version */
$values['deprecated.php'] = version_compare(PHP_VERSION, '5.5.9', '<');
// Register PHP shutdown functions to catch fatal errors & exceptions
ShutdownHandler::register();
parent::__construct($values);
$this->register(new PathServiceProvider());
// Initialize the config. Note that we do this here, on 'construct'.
// All other initialisation is triggered from bootstrap.php
// Warning!
// One of a valid ResourceManager ['resources'] or ClassLoader ['classloader']
// must be defined for working properly
if (!isset($this['resources'])) {
$this['resources'] = new Configuration\ResourceManager($this);
} else {
$this['classloader'] = $this['resources']->getClassLoader();
}
$this['resources']->setApp($this);
$this->initConfig();
$this->initLogger();
$this['resources']->initialize();
if (($debugOverride = $this['config']->get('general/debug')) !== null) {
$this['debug'] = $debugOverride;
}
// Re-register the shutdown functions now that we know our debug setting
ShutdownHandler::register($this['debug']);
if (!isset($this['environment'])) {
$this['environment'] = $this['debug'] ? 'development' : 'production';
}
if (($locales = $this['config']->get('general/locale')) !== null) {
$locales = (array) $locales;
$this['locale'] = reset($locales);
}
// Initialize the 'editlink' and 'edittitle'.
$this['editlink'] = '';
$this['edittitle'] = '';
// Initialize the JavaScript data gateway.
$this['jsdata'] = [];
}