From: Timo Tijhof Date: Thu, 16 Apr 2015 02:16:15 +0000 (+0100) Subject: Make $wgDBerrorLogTZ actually default to $wgLocaltimezone X-Git-Tag: 1.31.0-rc.0~11507^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=b391983f144e0d526c1921bcc475bbbdadee6c4b;p=lhc%2Fweb%2Fwiklou.git Make $wgDBerrorLogTZ actually default to $wgLocaltimezone Change-Id: I6ef84bf6b91a6783d1ff1c3dd0c4016ebf076367 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 28bead7d92..0d56aa5e04 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1844,11 +1844,11 @@ $wgDBerrorLog = false; * * @par Examples: * @code - * $wgLocaltimezone = 'UTC'; - * $wgLocaltimezone = 'GMT'; - * $wgLocaltimezone = 'PST8PDT'; - * $wgLocaltimezone = 'Europe/Sweden'; - * $wgLocaltimezone = 'CET'; + * $wgDBerrorLogTZ = 'UTC'; + * $wgDBerrorLogTZ = 'GMT'; + * $wgDBerrorLogTZ = 'PST8PDT'; + * $wgDBerrorLogTZ = 'Europe/Sweden'; + * $wgDBerrorLogTZ = 'CET'; * @endcode * * @since 1.20 diff --git a/includes/Setup.php b/includes/Setup.php index b8139d976f..9a911564f9 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -565,6 +565,10 @@ if ( is_null( $wgLocalTZoffset ) ) { $wgLocalTZoffset = date( 'Z' ) / 60; } +if ( !$wgDBerrorLogTZ ) { + $wgDBerrorLogTZ = $wgLocaltimezone; +} + // Useful debug output if ( $wgCommandLineMode ) { $wgRequest = new FauxRequest( array() ); diff --git a/includes/debug/logger/LegacyLogger.php b/includes/debug/logger/LegacyLogger.php index edaef4a729..6027375a0d 100644 --- a/includes/debug/logger/LegacyLogger.php +++ b/includes/debug/logger/LegacyLogger.php @@ -253,7 +253,7 @@ class LegacyLogger extends AbstractLogger { global $wgDBerrorLogTZ; static $cachedTimezone = null; - if ( $wgDBerrorLogTZ && !$cachedTimezone ) { + if ( !$cachedTimezone ) { $cachedTimezone = new DateTimeZone( $wgDBerrorLogTZ ); }