Soeren.oldag has submitted this change and it was merged. Change subject: Remove global scope assumptions in entry point ......................................................................
Remove global scope assumptions in entry point See http://www.bn2vs.com/blog/2013/11/24/introduction-to-composer-for-mediawiki-developers/ Change-Id: I96c8e05190bff22249afcd788993fb5661ea2c84 --- M WikidataQualityExternalValidation.php 1 file changed, 29 insertions(+), 29 deletions(-) Approvals: Soeren.oldag: Verified; Looks good to me, approved diff --git a/WikidataQualityExternalValidation.php b/WikidataQualityExternalValidation.php index 92ce1f9..2fa5c2a 100644 --- a/WikidataQualityExternalValidation.php +++ b/WikidataQualityExternalValidation.php @@ -13,39 +13,39 @@ require_once __DIR__ . '/vendor/autoload.php'; } -// Set credits -$wgExtensionCredits[ 'specialpage' ][ ] = array ( - 'path' => __FILE__, - 'name' => 'WikidataQualityExternalValidation', - 'author' => 'BP2014N1', - 'url' => 'https://www.mediawiki.org/wiki/Extension:WikidataQualityExternalValidation', - 'descriptionmsg' => 'wikidataquality-external-validation-desc', - 'version' => '0.0.0' -); +call_user_func( function() { + // Set credits + $GLOBALS['wgExtensionCredits']['specialpage'][] = array( + 'path' => __FILE__, + 'name' => 'WikidataQualityExternalValidation', + 'author' => 'BP2014N1', + 'url' => 'https://www.mediawiki.org/wiki/Extension:WikidataQualityExternalValidation', + 'descriptionmsg' => 'wikidataquality-external-validation-desc', + 'version' => '0.0.0' + ); -// Initialize localization and aliases -$wgMessagesDirs[ 'WikidataQualityExternalValidation' ] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles[ 'WikidataQualityExternalValidationAlias' ] = __DIR__ . '/WikidataQualityExternalValidation.alias.php'; + // Initialize localization and aliases + $GLOBALS['wgMessagesDirs']['WikidataQualityExternalValidation'] = __DIR__ . '/i18n'; + $GLOBALS['wgExtensionMessagesFiles']['WikidataQualityExternalValidationAlias'] = __DIR__ . '/WikidataQualityExternalValidation.alias.php'; -// Initalize hooks for creating database tables -global $wgHooks; -$wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] = 'WikidataQualityExternalValidationHooks::onCreateSchema'; + // Initalize hooks for creating database tables + $GLOBALS['wgHooks']['LoadExtensionSchemaUpdates'][] = 'WikidataQualityExternalValidationHooks::onCreateSchema'; -// Register hooks for Unit Tests -$wgHooks[ 'UnitTestsList' ][ ] = 'WikidataQualityExternalValidationHooks::onUnitTestsList'; + // Register hooks for Unit Tests + $GLOBALS['wgHooks']['UnitTestsList'][] = 'WikidataQualityExternalValidationHooks::onUnitTestsList'; -// Initialize special pages -$wgSpecialPages[ 'CrossCheck' ] = 'WikidataQuality\ExternalValidation\Specials\SpecialCrossCheck'; -$wgSpecialPages[ 'ExternalDbs' ] = 'WikidataQuality\ExternalValidation\Specials\SpecialExternalDbs'; + // Initialize special pages + $GLOBALS['wgSpecialPages']['CrossCheck'] = 'WikidataQuality\ExternalValidation\Specials\SpecialCrossCheck'; + $GLOBALS['wgSpecialPages']['ExternalDbs'] = 'WikidataQuality\ExternalValidation\Specials\SpecialExternalDbs'; -// Define API modules -global $wgAPIModules; -$wgAPIModules[ 'wdqacrosscheck' ] = 'WikidataQuality\ExternalValidation\Api\CrossCheck'; + // Define API modules + $GLOBALS['wgAPIModules']['wdqacrosscheck'] = 'WikidataQuality\ExternalValidation\Api\CrossCheck'; -// Define database table names -define( 'DUMP_DATA_TABLE', 'wdqa_external_data' ); -define( 'DUMP_META_TABLE', 'wdqa_dump_information' ); -define( 'DUMP_IDENTIFIER_PROPERTIES_TABLE', 'wdqa_identifier_properties' ); + // Define database table names + define( 'DUMP_DATA_TABLE', 'wdqa_external_data' ); + define( 'DUMP_META_TABLE', 'wdqa_dump_information' ); + define( 'DUMP_IDENTIFIER_PROPERTIES_TABLE', 'wdqa_identifier_properties' ); -// Jobs -$wgJobClasses[ 'checkForCrossCheckViolations' ] = 'CheckForCrossCheckViolationsJob'; \ No newline at end of file + // Jobs + $GLOBALS['wgJobClasses']['checkForCrossCheckViolations'] = 'CheckForCrossCheckViolationsJob'; +} ); \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/206237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96c8e05190bff22249afcd788993fb5661ea2c84 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQualityExternalValidation Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Soeren.oldag <soeren_ol...@freenet.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits