mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 12:24:29 +02:00
Bootstrap/timezone: do not enforce config
The current way forces people running a correctly configured PHP to configure timezone once again in Icinga Web. We want LESS config, so this tries to fix this.
This commit is contained in:
parent
f498cd0c81
commit
559457f730
@ -457,7 +457,11 @@ abstract class ApplicationBootstrap
|
|||||||
*/
|
*/
|
||||||
protected function setupTimezone()
|
protected function setupTimezone()
|
||||||
{
|
{
|
||||||
$timeZoneString = $this->config->global !== null ? $this->config->global->get('timezone', 'UTC') : 'UTC';
|
$default = @date_default_timezone_get();
|
||||||
|
if (! $default) {
|
||||||
|
$default = 'UTC';
|
||||||
|
}
|
||||||
|
$timeZoneString = $this->config->global !== null ? $this->config->global->get('timezone', $default) : $default;
|
||||||
date_default_timezone_set($timeZoneString);
|
date_default_timezone_set($timeZoneString);
|
||||||
DateTimeFactory::setConfig(array('timezone' => $timeZoneString));
|
DateTimeFactory::setConfig(array('timezone' => $timeZoneString));
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user