aboutsummaryrefslogtreecommitdiffstats
path: root/includes/MWTimestamp.php
diff options
context:
space:
mode:
authorTChin <tchin@wikimedia.org>2022-01-06 13:44:56 -0500
committerTChin <tchin@wikimedia.org>2022-01-10 13:55:53 -0500
commit47adb6d65a9def579135a3d009fd1b22e99e51ba (patch)
treea8a90bace319d546819fc78ed682a024e0090f03 /includes/MWTimestamp.php
parentfb80b943b67a17a85111692fa4ac675f148f05e6 (diff)
downloadmediawikicore-47adb6d65a9def579135a3d009fd1b22e99e51ba.tar.gz
mediawikicore-47adb6d65a9def579135a3d009fd1b22e99e51ba.zip
Refactor global variables to use MediaWikiServices instead
Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
Diffstat (limited to 'includes/MWTimestamp.php')
-rw-r--r--includes/MWTimestamp.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php
index d92e69fbc30f..b2f0f128272b 100644
--- a/includes/MWTimestamp.php
+++ b/includes/MWTimestamp.php
@@ -171,9 +171,9 @@ class MWTimestamp extends ConvertibleTimestamp {
* @return MWTimestamp The local instance
*/
public static function getLocalInstance( $ts = false ) {
- global $wgLocaltimezone;
+ $localtimezone = MediaWikiServices::getInstance()->getMainConfig()->get( 'Localtimezone' );
$timestamp = new self( $ts );
- $timestamp->setTimezone( $wgLocaltimezone );
+ $timestamp->setTimezone( $localtimezone );
return $timestamp;
}
}