From: Niklas Laxström Date: Sat, 15 Mar 2008 10:46:28 +0000 (+0000) Subject: * Some cleanups X-Git-Tag: 1.31.0-rc.0~49083 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=479008a3f7ebd2aeda872fa9b8cd6de4a3bee4c8;p=lhc%2Fweb%2Fwiklou.git * Some cleanups --- diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 9f5cf834b8..8375d071e9 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -130,7 +130,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) { $res = $dbr->select( 'page', /* FROM */ 'page_title', /* WHAT */ - $where + array( $chunk), + $where + array($chunk), __METHOD__, array ('LIMIT' => 2, 'OFFSET' => $this->maxPerPage - 1, 'ORDER BY' => 'page_title') ); @@ -174,7 +174,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) { $out .= $this->showline ( $inpoint, $outpoint, $namespace, false ); } $out .= ''; - $nsForm = $this->namespaceForm ( $namespace, '', false ); + $nsForm = $this->namespaceForm( $namespace, '', false ); # Is there more? if ( $including ) { @@ -319,7 +319,7 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { } } - $nsForm = $this->namespaceForm ( $namespace, $from ); + $nsForm = $this->namespaceForm( $namespace, $from ); $out2 = ''; $out2 .= '
' . $nsForm; $out2 .= '' . diff --git a/includes/SpecialMostlinked.php b/includes/SpecialMostlinked.php index 916f219bd1..1827d965ba 100644 --- a/includes/SpecialMostlinked.php +++ b/includes/SpecialMostlinked.php @@ -43,7 +43,7 @@ class MostlinkedPage extends QueryPage { if( $db->numRows( $res ) > 0 ) { $linkBatch = new LinkBatch(); while( $row = $db->fetchObject( $res ) ) - $linkBatch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $linkBatch->add( $row->namespace, $row->title ); $db->dataSeek( $res, 0 ); $linkBatch->execute(); } diff --git a/includes/SpecialMostlinkedcategories.php b/includes/SpecialMostlinkedcategories.php index c357c8f408..9d7a968047 100644 --- a/includes/SpecialMostlinkedcategories.php +++ b/includes/SpecialMostlinkedcategories.php @@ -38,7 +38,7 @@ class MostlinkedCategoriesPage extends QueryPage { function preprocessResults( $db, $res ) { $batch = new LinkBatch; while ( $row = $db->fetchObject( $res ) ) - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $batch->add( $row->namespace, $row->title ); $batch->execute(); // Back to start for display diff --git a/includes/SpecialMostlinkedtemplates.php b/includes/SpecialMostlinkedtemplates.php index b0f1b196e4..fb82ff4fe3 100644 --- a/includes/SpecialMostlinkedtemplates.php +++ b/includes/SpecialMostlinkedtemplates.php @@ -69,15 +69,14 @@ class SpecialMostlinkedtemplates extends QueryPage { * @param Database $dbr Database connection * @param int $res Result pointer */ - public function preprocessResults( $dbr, $res ) { + public function preprocessResults( $db, $res ) { $batch = new LinkBatch(); - while( $row = $dbr->fetchObject( $res ) ) { - $title = Title::makeTitleSafe( $row->namespace, $row->title ); - $batch->addObj( $title ); + while( $row = $db->fetchObject( $res ) ) { + $batch->add( $row->namespace, $row->title ); } $batch->execute(); - if( $dbr->numRows( $res ) > 0 ) - $dbr->dataSeek( $res, 0 ); + if( $db->numRows( $res ) > 0 ) + $db->dataSeek( $res, 0 ); } /** diff --git a/includes/SpecialShortpages.php b/includes/SpecialShortpages.php index 5aa363862b..c698e231d1 100644 --- a/includes/SpecialShortpages.php +++ b/includes/SpecialShortpages.php @@ -12,7 +12,7 @@ class ShortPagesPage extends QueryPage { function getName() { - return "Shortpages"; + return 'Shortpages'; } /** @@ -47,7 +47,7 @@ class ShortPagesPage extends QueryPage { if( $this->isCached() ) { $batch = new LinkBatch(); while( $row = $db->fetchObject( $res ) ) - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $batch->add( $row->namespace, $row->title ); $batch->execute(); if( $db->numRows( $res ) > 0 ) $db->dataSeek( $res, 0 ); diff --git a/includes/SpecialWantedcategories.php b/includes/SpecialWantedcategories.php index 580cc6de65..0f554db119 100644 --- a/includes/SpecialWantedcategories.php +++ b/includes/SpecialWantedcategories.php @@ -10,9 +10,17 @@ */ class WantedCategoriesPage extends QueryPage { - function getName() { return 'Wantedcategories'; } - function isExpensive() { return true; } - function isSyndicated() { return false; } + function getName() { + return 'Wantedcategories'; + } + + function isExpensive() { + return true; + } + + function isSyndicated() { + return false; + } function getSQL() { $dbr = wfGetDB( DB_SLAVE ); @@ -40,7 +48,7 @@ class WantedCategoriesPage extends QueryPage { function preprocessResults( $db, $res ) { $batch = new LinkBatch; while ( $row = $db->fetchObject( $res ) ) - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $batch->add( $row->namespace, $row->title ); $batch->execute(); // Back to start for display diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 1fb8cdbb48..0600e99dcb 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -54,7 +54,7 @@ class WantedPagesPage extends QueryPage { function preprocessResults( $db, $res ) { $batch = new LinkBatch; while ( $row = $db->fetchObject( $res ) ) - $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $batch->add( $row->namespace, $row->title ); $batch->execute(); // Back to start for display diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index f89cdcccc6..d5496d0e9b 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -25,9 +25,9 @@ class WhatLinksHerePage { private $namespace; - function WhatLinksHerePage( &$request, $par = null ) { + function WhatLinksHerePage( $request, $par = null ) { global $wgUser; - $this->request =& $request; + $this->request = $request; $this->skin = $wgUser->getSkin(); $this->par = $par; }