mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-21 02:44:51 +08:00
set application timezone early in application constructor, set default of UTC if no timezone is configured at all (not in app config nor in php.ini)
This commit is contained in:
@ -85,6 +85,10 @@ class Application extends Module
|
|||||||
throw new InvalidConfigException('The "basePath" configuration is required.');
|
throw new InvalidConfigException('The "basePath" configuration is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($config['timeZone']) || !ini_get('date.timezone')) {
|
||||||
|
$this->setTimeZone( \yii\helpers\ArrayHelper::remove($config,'timeZone','UTC') );
|
||||||
|
}
|
||||||
|
|
||||||
$this->registerErrorHandlers();
|
$this->registerErrorHandlers();
|
||||||
$this->registerCoreComponents();
|
$this->registerCoreComponents();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user