r32013 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32012‎ | r32013 | r32014 >
Date:10:46, 15 March 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Some cleanups
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinkedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinkedtemplates.php (modified) (history)
  • /trunk/phase3/includes/SpecialShortpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -130,7 +130,7 @@
131131 $res = $dbr->select(
132132 'page', /* FROM */
133133 'page_title', /* WHAT */
134 - $where + array( $chunk),
 134+ $where + array($chunk),
135135 __METHOD__,
136136 array ('LIMIT' => 2, 'OFFSET' => $this->maxPerPage - 1, 'ORDER BY' => 'page_title') );
137137
@@ -174,7 +174,7 @@
175175 $out .= $this->showline ( $inpoint, $outpoint, $namespace, false );
176176 }
177177 $out .= '</table>';
178 - $nsForm = $this->namespaceForm ( $namespace, '', false );
 178+ $nsForm = $this->namespaceForm( $namespace, '', false );
179179
180180 # Is there more?
181181 if ( $including ) {
@@ -319,7 +319,7 @@
320320 }
321321 }
322322
323 - $nsForm = $this->namespaceForm ( $namespace, $from );
 323+ $nsForm = $this->namespaceForm( $namespace, $from );
324324 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
325325 $out2 .= '<tr valign="top"><td>' . $nsForm;
326326 $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
Index: trunk/phase3/includes/SpecialWhatlinkshere.php
@@ -25,9 +25,9 @@
2626
2727 private $namespace;
2828
29 - function WhatLinksHerePage( &$request, $par = null ) {
 29+ function WhatLinksHerePage( $request, $par = null ) {
3030 global $wgUser;
31 - $this->request =& $request;
 31+ $this->request = $request;
3232 $this->skin = $wgUser->getSkin();
3333 $this->par = $par;
3434 }
Index: trunk/phase3/includes/SpecialMostlinkedtemplates.php
@@ -69,15 +69,14 @@
7070 * @param Database $dbr Database connection
7171 * @param int $res Result pointer
7272 */
73 - public function preprocessResults( $dbr, $res ) {
 73+ public function preprocessResults( $db, $res ) {
7474 $batch = new LinkBatch();
75 - while( $row = $dbr->fetchObject( $res ) ) {
76 - $title = Title::makeTitleSafe( $row->namespace, $row->title );
77 - $batch->addObj( $title );
 75+ while( $row = $db->fetchObject( $res ) ) {
 76+ $batch->add( $row->namespace, $row->title );
7877 }
7978 $batch->execute();
80 - if( $dbr->numRows( $res ) > 0 )
81 - $dbr->dataSeek( $res, 0 );
 79+ if( $db->numRows( $res ) > 0 )
 80+ $db->dataSeek( $res, 0 );
8281 }
8382
8483 /**
Index: trunk/phase3/includes/SpecialMostlinked.php
@@ -43,7 +43,7 @@
4444 if( $db->numRows( $res ) > 0 ) {
4545 $linkBatch = new LinkBatch();
4646 while( $row = $db->fetchObject( $res ) )
47 - $linkBatch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 47+ $linkBatch->add( $row->namespace, $row->title );
4848 $db->dataSeek( $res, 0 );
4949 $linkBatch->execute();
5050 }
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php
@@ -38,7 +38,7 @@
3939 function preprocessResults( $db, $res ) {
4040 $batch = new LinkBatch;
4141 while ( $row = $db->fetchObject( $res ) )
42 - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 42+ $batch->add( $row->namespace, $row->title );
4343 $batch->execute();
4444
4545 // Back to start for display
Index: trunk/phase3/includes/SpecialShortpages.php
@@ -12,7 +12,7 @@
1313 class ShortPagesPage extends QueryPage {
1414
1515 function getName() {
16 - return "Shortpages";
 16+ return 'Shortpages';
1717 }
1818
1919 /**
@@ -47,7 +47,7 @@
4848 if( $this->isCached() ) {
4949 $batch = new LinkBatch();
5050 while( $row = $db->fetchObject( $res ) )
51 - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 51+ $batch->add( $row->namespace, $row->title );
5252 $batch->execute();
5353 if( $db->numRows( $res ) > 0 )
5454 $db->dataSeek( $res, 0 );
Index: trunk/phase3/includes/SpecialWantedcategories.php
@@ -10,10 +10,18 @@
1111 */
1212 class WantedCategoriesPage extends QueryPage {
1313
14 - function getName() { return 'Wantedcategories'; }
15 - function isExpensive() { return true; }
16 - function isSyndicated() { return false; }
 14+ function getName() {
 15+ return 'Wantedcategories';
 16+ }
1717
 18+ function isExpensive() {
 19+ return true;
 20+ }
 21+
 22+ function isSyndicated() {
 23+ return false;
 24+ }
 25+
1826 function getSQL() {
1927 $dbr = wfGetDB( DB_SLAVE );
2028 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
@@ -40,7 +48,7 @@
4149 function preprocessResults( $db, $res ) {
4250 $batch = new LinkBatch;
4351 while ( $row = $db->fetchObject( $res ) )
44 - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 52+ $batch->add( $row->namespace, $row->title );
4553 $batch->execute();
4654
4755 // Back to start for display
Index: trunk/phase3/includes/SpecialWantedpages.php
@@ -54,7 +54,7 @@
5555 function preprocessResults( $db, $res ) {
5656 $batch = new LinkBatch;
5757 while ( $row = $db->fetchObject( $res ) )
58 - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 58+ $batch->add( $row->namespace, $row->title );
5959 $batch->execute();
6060
6161 // Back to start for display

Status & tagging log