r49305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49304‎ | r49305 | r49306 >
Date:10:06, 8 April 2009
Author:jojo
Status:ok
Tags:
Comment:
fix: moved pageInCategory() to hooks
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.hooks.php
@@ -357,4 +357,13 @@
358358 }
359359 }
360360
 361+ static protected function pageInCategory( $pageId, $categoryName ) {
 362+ $dbr = wfGetDB( DB_SLAVE );
 363+ $count = $dbr->selectField( 'categorylinks', 'COUNT(*)',
 364+ array(
 365+ 'cl_from' => $pageId,
 366+ 'cl_to' => $categoryName ),
 367+ __METHOD__ );
 368+ return ($count > 0);
 369+ }
361370 }
Index: trunk/extensions/Collection/Collection.body.php
@@ -906,16 +906,6 @@
907907 $wgOut->addTemplate( $template );
908908 }
909909
910 - static protected function pageInCategory( $pageId, $categoryName ) {
911 - $dbr = wfGetDB( DB_SLAVE );
912 - $count = $dbr->selectField( 'categorylinks', 'COUNT(*)',
913 - array(
914 - 'cl_from' => $pageId,
915 - 'cl_to' => $categoryName ),
916 - __METHOD__ );
917 - return ($count > 0);
918 - }
919 -
920910 static function mwServeCommand( $command, $args, $timeout=true, $toFile=null ) {
921911 global $wgOut;
922912 global $wgCollectionMWServeURL;

Status & tagging log