From c9673bfea308800036e0addfa04617246a13a0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Mon, 2 Sep 2013 16:29:06 +0200 Subject: [PATCH] Catch database errors, set fallback tz The fallback timezone is set in case an error occurs before setupTimezone() is entered. In this case the user is presented with an warning about missing timezone settings if the php.ini doesn't contain timezone information refs #4529 --- library/Icinga/Application/Web.php | 3 ++- public/index.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 2661c2a5a..100cf5153 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -308,13 +308,14 @@ class Web extends ApplicationBootstrap try { $initialPreferences = $preferenceStore->load(); } catch (Exception $e) { - Logger::fatal( + Logger::warn( '%s::%s: Could not load preferences from provider. ' . 'An exception during bootstrap was thrown: %s', __CLASS__, __FUNCTION__, $e->getMessage() ); + $this->registerFallbackPreferenceProvider($preferences, $user); } $sessionStore->writeAll($initialPreferences); diff --git a/public/index.php b/public/index.php index 6525abe3a..28a208270 100644 --- a/public/index.php +++ b/public/index.php @@ -2,6 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} +date_default_timezone_set('UTC'); require_once dirname(__FILE__). '/../library/Icinga/Application/ApplicationBootstrap.php'; require_once dirname(__FILE__). '/../library/Icinga/Application/Web.php';