Browse Source

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)

tags/2.0.0-beta
Benjamin Wöster 12 years ago
parent
commit
b8ad3567e4
  1. 4
      yii/base/Application.php

4
yii/base/Application.php

@ -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();

Loading…
Cancel
Save