http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88178
Revision: 88178 Author: robla Date: 2011-05-15 13:42:10 +0000 (Sun, 15 May 2011) Log Message: ----------- Setting $wgLocalTZoffset based on $wgLocaltimezone, using code that used to be in a comment in DefaultSettings. Pair programmed with hashar. Modified Paths: -------------- trunk/phase3/includes/DefaultSettings.php trunk/phase3/includes/Setup.php Modified: trunk/phase3/includes/DefaultSettings.php =================================================================== --- trunk/phase3/includes/DefaultSettings.php 2011-05-15 13:36:59 UTC (rev 88177) +++ trunk/phase3/includes/DefaultSettings.php 2011-05-15 13:42:10 UTC (rev 88178) @@ -2110,17 +2110,7 @@ * This setting is used for most date/time displays in the software, and is * overrideable in user preferences. It is *not* used for signature timestamps. * - * You can set it to match the configured server timezone like this: - * $wgLocalTZoffset = date("Z") / 60; - * - * If your server is not configured for the timezone you want, you can set - * this in conjunction with the signature timezone and override the PHP default - * timezone like so: - * $wgLocaltimezone="Europe/Berlin"; - * date_default_timezone_set( $wgLocaltimezone ); - * $wgLocalTZoffset = date("Z") / 60; - * - * Leave at NULL to show times in universal time (UTC/GMT). + * By default, this will be set to match $wgLocaltimezone. */ $wgLocalTZoffset = null; Modified: trunk/phase3/includes/Setup.php =================================================================== --- trunk/phase3/includes/Setup.php 2011-05-15 13:36:59 UTC (rev 88177) +++ trunk/phase3/includes/Setup.php 2011-05-15 13:42:10 UTC (rev 88178) @@ -346,9 +346,14 @@ * explicitly set. Inspired by phpMyAdmin's treatment of the problem. */ wfSuppressWarnings(); -date_default_timezone_set( date_default_timezone_get() ); +if(!isset($wgLocaltimezone)) $wgLocaltimezone = date_default_timezone_get(); wfRestoreWarnings(); +date_default_timezone_set( $wgLocaltimezone ); +if(!isset($wgLocalTZoffset)) { + $wgLocalTZoffset = date('Z') / 60; +} + # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor $wgRequest = new WebRequest; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs