r87233 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87232‎ | r87233 | r87234 >
Date:01:21, 2 May 2011
Author:demon
Status:ok
Tags:
Comment:
MFT r86451: FR changes for GNSM
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/FlaggedRevs (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/FlaggedRevs/FlaggedRevs.php
@@ -475,6 +475,9 @@
476476 # Stable dump hook
477477 $wgHooks['WikiExporter::dumpStableQuery'][] = 'FlaggedRevsHooks::stableDumpQuery';
478478
 479+# GNSM category hooks
 480+$wgHooks['GoogleNewsSitemap::Query'][] = 'FlaggedRevsHooks::gnsmQueryModifier';
 481+
479482 # Duplicate flagged* tables in parserTests.php
480483 $wgHooks['ParserTestTables'][] = 'FlaggedRevsHooks::onParserTestTables';
481484 # Integration tests
Index: branches/wmf/1.17wmf1/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -2144,4 +2144,32 @@
21452145 }
21462146 return true;
21472147 }
 2148+
 2149+ public static function gnsmQueryModifier( array $params, array &$joins, array &$conditions ) {
 2150+ $filterSet = array( GoogleNewsSitemap::OPT_ONLY, GoogleNewsSitemap::OPT_EXCLUDE );
 2151+ # Either involves the same JOIN here...
 2152+ if ( isset( $filterSet[ $params['stable'] ] ) || isset( $filterSet[ $params['quality'] ] ) ) {
 2153+ $joins['flaggedpages'] = array( 'LEFT JOIN', 'page_id = fp_page_id' );
 2154+ }
 2155+
 2156+ switch( $params['stable'] ) {
 2157+ case GoogleNewsSitemap::OPT_ONLY:
 2158+ $conditions[] = 'fp_stable IS NOT NULL ';
 2159+ break;
 2160+ case GoogleNewsSitemap::OPT_EXCLUDE:
 2161+ $conditions['fp_stable'] = null;
 2162+ break;
 2163+ }
 2164+
 2165+ switch( $params['quality'] ) {
 2166+ case GoogleNewsSitemap::OPT_ONLY:
 2167+ $conditions[] = 'fp_quality >= 1';
 2168+ break;
 2169+ case GoogleNewsSitemap::OPT_EXCLUDE:
 2170+ $conditions['fp_quality'] = 0;
 2171+ break;
 2172+ }
 2173+
 2174+ return true;
 2175+ }
21482176 }
Property changes on: branches/wmf/1.17wmf1/extensions/FlaggedRevs
___________________________________________________________________
Modified: svn:mergeinfo
21492177 Merged /trunk/extensions/FlaggedRevs:r86451

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86451* Move FlaggedRevs integration for GNSM to a hook that FlaggedRevs can use...mah02:38, 20 April 2011

Status & tagging log