Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/180554
Change subject: [WIP/POC] SpecialTrackingCategories: Read from the extension
registry
......................................................................
[WIP/POC] SpecialTrackingCategories: Read from the extension registry
This is a POC demonstrating how we can transition from extensions
putting things into the global scope ($wgTrackingCategories) to
instead storing them in the extension registry.
Change-Id: Ie0df4c20b123dac784a1c02eb991edc609a911b6
---
M includes/registration/ExtensionProcessor.php
M includes/specials/SpecialTrackingCategories.php
2 files changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/54/180554/1
diff --git a/includes/registration/ExtensionProcessor.php
b/includes/registration/ExtensionProcessor.php
index f42e9f3..a3d4cce 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -11,7 +11,6 @@
'ResourceLoaderSources',
'ResourceLoaderLESSVars',
'ResourceLoaderLESSImportPaths',
- 'TrackingCategories',
'DefaultUserOptions',
'HiddenPrefs',
'GroupPermissions',
diff --git a/includes/specials/SpecialTrackingCategories.php
b/includes/specials/SpecialTrackingCategories.php
index 7684c05..182c8b7 100644
--- a/includes/specials/SpecialTrackingCategories.php
+++ b/includes/specials/SpecialTrackingCategories.php
@@ -120,8 +120,12 @@
* @return array Array( 'msg' => Title, 'cats' => Title[] )
*/
private function prepareTrackingCategoriesData() {
+ $categories = array_merge(
+ $this->getConfig()->get( 'TrackingCategories' ),
+ ExtensionRegistry::getInstance()->getAttribute(
'TrackingCategories' )
+ );
$trackingCategories = array();
- foreach ( $this->getConfig()->get( 'TrackingCategories' ) as
$catMsg ) {
+ foreach ( $categories as $catMsg ) {
/*
* Check if the tracking category varies by namespace
* Otherwise only pages in the current namespace will
be displayed
--
To view, visit https://gerrit.wikimedia.org/r/180554
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0df4c20b123dac784a1c02eb991edc609a911b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits