r102444 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102443‎ | r102444 | r102445 >
Date:21:13, 8 November 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Added FLAGGED_REVISIONS constant to replace ugly function_exists check in DPL
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/intersection/DynamicPageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -23,6 +23,9 @@
2424 exit( 1 );
2525 }
2626
 27+# Stable constant to let extensions be aware that this is enabled
 28+define( 'FLAGGED_REVISIONS', true );
 29+
2730 $wgExtensionCredits['specialpage'][] = array(
2831 'path' => __FILE__,
2932 'name' => 'Flagged Revisions',
Index: trunk/extensions/intersection/DynamicPageList.php
@@ -452,7 +452,7 @@
453453
454454 // Bug 14943 - Allow filtering based on FlaggedRevs stability.
455455 // Check if the extension actually exists before changing the query...
456 - if ( function_exists( 'efLoadFlaggedRevs' ) && $flaggedRevs ) {
 456+ if ( $flaggedRevs && defined( 'FLAGGED_REVISIONS' ) ) {
457457 $tables[] = 'flaggedpages';
458458 $join['flaggedpages'] = array( 'LEFT JOIN', 'page_id = fp_page_id' );
459459

Comments

#Comment by Hashar (talk | contribs)   16:04, 23 November 2011

Maybe we should prefix our constants with MW_. Doesn't hurt anyway.

Status & tagging log