Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66243
Change subject: Moves wgValueFormatters global definition in MW specific initialization file ...................................................................... Moves wgValueFormatters global definition in MW specific initialization file This global is MW specific and should therefore not be defined or used in the ValueFormatter's own files. Change-Id: I3dac34c53fc8de7ac7185cec398ae3257da96b1b --- M ValueFormatters/ValueFormatters.mw.php M ValueFormatters/ValueFormatters.php 2 files changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/43/66243/1 diff --git a/ValueFormatters/ValueFormatters.mw.php b/ValueFormatters/ValueFormatters.mw.php index 5c0d678..bf49728 100644 --- a/ValueFormatters/ValueFormatters.mw.php +++ b/ValueFormatters/ValueFormatters.mw.php @@ -31,7 +31,8 @@ die( 'Not an entry point.' ); } -global $wgExtensionCredits, $wgExtensionMessagesFiles, $wgAutoloadClasses, $wgHooks; +global $wgExtensionCredits, $wgExtensionMessagesFiles, $wgAutoloadClasses, $wgHooks, + $wgValueFormatters; $wgExtensionCredits['datavalues'][] = array( 'path' => __DIR__, @@ -44,6 +45,10 @@ $wgExtensionMessagesFiles['ValueFormatters'] = __DIR__ . '/ValueFormatters.i18n.php'; +$wgValueFormatters = array( + 'geocoordinate' => 'ValueFormatters\GeoCoordinateFormatter' +); + foreach (include(__DIR__ . '/ValueFormatters.classes.php') as $class => $file ) { if ( !array_key_exists( $class, $GLOBALS['wgAutoloadLocalClasses'] ) ) { $wgAutoloadClasses[$class] = __DIR__ . '/' . $file; diff --git a/ValueFormatters/ValueFormatters.php b/ValueFormatters/ValueFormatters.php index 9393962..35c3193 100644 --- a/ValueFormatters/ValueFormatters.php +++ b/ValueFormatters/ValueFormatters.php @@ -47,12 +47,6 @@ define( 'ValueFormatters_VERSION', '0.1 alpha' ); -global $wgValueFormatters; - -$wgValueFormatters = array(); - -$wgValueFormatters['geocoordinate'] = 'ValueFormatters\GeoCoordinateFormatter'; - if ( defined( 'MEDIAWIKI' ) ) { include __DIR__ . '/ValueFormatters.mw.php'; } -- To view, visit https://gerrit.wikimedia.org/r/66243 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3dac34c53fc8de7ac7185cec398ae3257da96b1b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Werner <daniel.wer...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits