r66659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66658‎ | r66659 | r66660 >
Date:21:33, 19 May 2010
Author:aaron
Status:ok
Tags:
Comment:
Disable api modules when UI counterparts are disabled
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -379,6 +379,7 @@
380380 $wgAutoloadClasses['ValidationStatistics'] = $dir . 'specialpages/ValidationStatistics_body.php';
381381 $wgExtensionMessagesFiles['ValidationStatistics'] = $langDir . 'ValidationStatistics.i18n.php';
382382 $wgSpecialPageGroups['ValidationStatistics'] = 'quality';
 383+
383384 # API Modules
384385 $wgAutoloadClasses['FlaggedRevsApiHooks'] = $dir . 'api/FlaggedRevsApi.hooks.php';
385386 # OldReviewedPages for API
@@ -386,10 +387,8 @@
387388 $wgAPIListModules['oldreviewedpages'] = 'ApiQueryOldreviewedpages';
388389 # UnreviewedPages for API
389390 $wgAutoloadClasses['ApiQueryUnreviewedpages'] = $dir . 'api/ApiQueryUnreviewedpages.php';
390 -$wgAPIListModules['unreviewedpages'] = 'ApiQueryUnreviewedpages';
391391 # ReviewedPages for API
392392 $wgAutoloadClasses['ApiQueryReviewedpages'] = $dir . 'api/ApiQueryReviewedpages.php';
393 -$wgAPIListModules['reviewedpages'] = 'ApiQueryReviewedpages';
394393 # Flag metadata for pages for API
395394 $wgAutoloadClasses['ApiQueryFlagged'] = $dir . 'api/ApiQueryFlagged.php';
396395 $wgAPIPropModules['flagged'] = 'ApiQueryFlagged';
@@ -561,6 +560,12 @@
562561 # Don't show autoreview group everywhere
563562 global $wgImplicitGroups;
564563 $wgImplicitGroups[] = 'autoreview';
 564+ # Conditional API modules
 565+ global $wgAPIListModules;
 566+ if ( !FlaggedRevs::stableOnlyIfConfigured() ) {
 567+ $wgAPIListModules['reviewedpages'] = 'ApiQueryReviewedpages';
 568+ $wgAPIListModules['unreviewedpages'] = 'ApiQueryUnreviewedpages';
 569+ }
565570 }
566571
567572 # Add review log

Status & tagging log