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
This commit is contained in:
Jannis Moßhammer 2013-09-02 16:29:06 +02:00 committed by Eric Lippmann
parent 95bc8a2f4f
commit c9673bfea3
2 changed files with 3 additions and 1 deletions

View File

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

View File

@ -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';