From b391983f144e0d526c1921bcc475bbbdadee6c4b Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 16 Apr 2015 03:16:15 +0100 Subject: [PATCH] Make $wgDBerrorLogTZ actually default to $wgLocaltimezone Change-Id: I6ef84bf6b91a6783d1ff1c3dd0c4016ebf076367 --- includes/DefaultSettings.php | 10 +++++----- includes/Setup.php | 4 ++++ includes/debug/logger/LegacyLogger.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) 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 ); } -- 2.20.1