r51597 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51596‎ | r51597 | r51598 >
Date:17:30, 8 June 2009
Author:catrope
Status:deferred
Tags:
Comment:
querypage-work: Replacing wfSpecialWhatever() functions with real constructors for querypages
Modified paths:
  • /branches/querypage-work/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/querypage-work/phase3/includes/QueryPage.php (modified) (history)
  • /branches/querypage-work/phase3/includes/SpecialPage.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialAncientpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialDeadendpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialDisambiguations.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialLinkSearch.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialListredirects.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialLonelypages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialLongpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostimages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostlinked.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostlinkedcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostlinkedtemplates.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMostrevisions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialPopularpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialShortpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUncategorizedcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUncategorizedimages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUncategorizedpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUncategorizedtemplates.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUnusedcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUnusedimages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUnusedtemplates.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUnwatchedpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedfiles.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWithoutinterwiki.php (modified) (history)

Diff [purge]

Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedtemplates.php
@@ -13,7 +13,10 @@
1414 */
1515 class UnusedtemplatesPage extends QueryPage {
1616
17 - function getName() { return( 'Unusedtemplates' ); }
 17+ function __construct() {
 18+ SpecialPage::__construct( 'Unusedtemplates' );
 19+ }
 20+
1821 // inexpensive?
1922 function isExpensive() { return true; }
2023 function isSyndicated() { return false; }
@@ -50,8 +53,3 @@
5154
5255 }
5356
54 -function wfSpecialUnusedtemplates() {
55 - list( $limit, $offset ) = wfCheckLimits();
56 - $utp = new UnusedtemplatesPage();
57 - $utp->doQuery( $offset, $limit );
58 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialMostcategories.php
@@ -14,7 +14,10 @@
1515 */
1616 class MostcategoriesPage extends QueryPage {
1717
18 - function getName() { return 'Mostcategories'; }
 18+ function __construct() {
 19+ SpecialPage::__construct( 'Mostcategories' );
 20+ }
 21+
1922 function isExpensive() { return true; }
2023 function isSyndicated() { return false; }
2124
@@ -41,14 +44,3 @@
4245 return wfSpecialList( $link, $count );
4346 }
4447 }
45 -
46 -/**
47 - * constructor
48 - */
49 -function wfSpecialMostcategories() {
50 - list( $limit, $offset ) = wfCheckLimits();
51 -
52 - $wpp = new MostcategoriesPage();
53 -
54 - $wpp->doQuery( $offset, $limit );
55 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedimages.php
@@ -13,8 +13,8 @@
1414 // FIXME: Use an instance of UncategorizedPagesPage or something
1515 class UncategorizedImagesPage extends ImageQueryPage {
1616
17 - function getName() {
18 - return 'Uncategorizedimages';
 17+ function __construct() {
 18+ SpecialPage::__construct( 'Uncategorizedimages' );
1919 }
2020
2121 function sortDescending() {
@@ -45,9 +45,3 @@
4646 }
4747
4848 }
49 -
50 -function wfSpecialUncategorizedimages() {
51 - $uip = new UncategorizedImagesPage();
52 - list( $limit, $offset ) = wfCheckLimits();
53 - return $uip->doQuery( $offset, $limit );
54 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php
@@ -11,13 +11,25 @@
1212 class WantedPagesPage extends WantedQueryPage {
1313 var $nlinks;
1414
15 - function WantedPagesPage( $inc = false, $nlinks = true ) {
16 - $this->setListoutput( $inc );
17 - $this->nlinks = $nlinks;
 15+ function __construct() {
 16+ SpecialPage::__construct( 'Wantedpages' );
1817 }
 18+
 19+ function execute( $par ) {
 20+ $inc = $this->including();
1921
20 - function getName() {
21 - return 'Wantedpages';
 22+ if ( $inc ) {
 23+ @list( $limit, $nlinks ) = explode( '/', $par, 2 );
 24+ $this->limit = (int)$limit;
 25+ // FIXME: nlinks is ignored
 26+ $nlinks = $nlinks === 'nlinks';
 27+ $this->offset = 0;
 28+ } else {
 29+ $nlinks = true;
 30+ }
 31+ $this->setListOutput( $inc );
 32+ $this->shownavigation = !$inc;
 33+ parent::execute( $par );
2234 }
2335
2436 function getSQL() {
@@ -74,24 +86,3 @@
7587 return $query;
7688 }
7789 }
78 -
79 -/**
80 - * constructor
81 - */
82 -function wfSpecialWantedpages( $par = null, $specialPage ) {
83 - $inc = $specialPage->including();
84 -
85 - if ( $inc ) {
86 - @list( $limit, $nlinks ) = explode( '/', $par, 2 );
87 - $limit = (int)$limit;
88 - $nlinks = $nlinks === 'nlinks';
89 - $offset = 0;
90 - } else {
91 - list( $limit, $offset ) = wfCheckLimits();
92 - $nlinks = true;
93 - }
94 -
95 - $wpp = new WantedPagesPage( $inc, $nlinks );
96 -
97 - $wpp->doQuery( $offset, $limit, !$inc );
98 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialPopularpages.php
@@ -1,17 +1,12 @@
22 <?php
33 /**
4 - * @file
5 - * @ingroup SpecialPage
6 - */
7 -
8 -/**
94 * implements Special:Popularpages
105 * @ingroup SpecialPage
116 */
127 class PopularPagesPage extends QueryPage {
138
14 - function getName() {
15 - return "Popularpages";
 9+ function __construct() {
 10+ SpecialPage::__construct( 'Popularpages' );
1611 }
1712
1813 function isExpensive() {
@@ -39,14 +34,3 @@
4035 return wfSpecialList($link, $nv);
4136 }
4237 }
43 -
44 -/**
45 - * Constructor
46 - */
47 -function wfSpecialPopularpages() {
48 - list( $limit, $offset ) = wfCheckLimits();
49 -
50 - $ppp = new PopularPagesPage();
51 -
52 - return $ppp->doQuery( $offset, $limit );
53 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUnwatchedpages.php
@@ -15,7 +15,10 @@
1616 */
1717 class UnwatchedpagesPage extends QueryPage {
1818
19 - function getName() { return 'Unwatchedpages'; }
 19+ function __construct() {
 20+ SpecialPage::__construct( 'Unwatchedpages' );
 21+ }
 22+
2023 // inexpensive?
2124 function isExpensive() { return true; }
2225 function isSyndicated() { return false; }
@@ -40,6 +43,7 @@
4144
4245 function getOrderFields() {
4346 return array( 'page_namespace', 'page_title' );
 47+ }
4448
4549 function formatResult( $skin, $result ) {
4650 global $wgContLang;
@@ -52,20 +56,4 @@
5357
5458 return wfSpecialList( $plink, $wlink );
5559 }
56 -}
57 -
58 -/**
59 - * constructor
60 - */
61 -function wfSpecialUnwatchedpages() {
62 - global $wgUser, $wgOut;
63 -
64 - if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
65 - return $wgOut->permissionRequired( 'unwatchedpages' );
66 -
67 - list( $limit, $offset ) = wfCheckLimits();
68 -
69 - $wpp = new UnwatchedpagesPage();
70 -
71 - $wpp->doQuery( $offset, $limit );
72 -}
 60+}
\ No newline at end of file
Index: branches/querypage-work/phase3/includes/specials/SpecialMostimages.php
@@ -14,7 +14,10 @@
1515 */
1616 class MostimagesPage extends ImageQueryPage {
1717
18 - function getName() { return 'Mostimages'; }
 18+ function __construct() {
 19+ SpecialPage::__construct( 'Mostimages' );
 20+ }
 21+
1922 function isExpensive() { return true; }
2023 function isSyndicated() { return false; }
2124
@@ -36,14 +39,3 @@
3740 }
3841
3942 }
40 -
41 -/**
42 - * Constructor
43 - */
44 -function wfSpecialMostimages() {
45 - list( $limit, $offset ) = wfCheckLimits();
46 -
47 - $wpp = new MostimagesPage();
48 -
49 - $wpp->doQuery( $offset, $limit );
50 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -11,10 +11,10 @@
1212 */
1313 class DoubleRedirectsPage extends PageQueryPage {
1414
15 - function getName() {
16 - return 'DoubleRedirects';
 15+ function __construct() {
 16+ SpecialPage::__construct( 'DoubleRedirects' );
1717 }
18 -
 18+
1919 // inexpensive?
2020 function isExpensive() { return true; }
2121 function isSyndicated() { return false; }
@@ -90,15 +90,3 @@
9191 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
9292 }
9393 }
94 -
95 -/**
96 - * constructor
97 - */
98 -function wfSpecialDoubleRedirects() {
99 - list( $limit, $offset ) = wfCheckLimits();
100 -
101 - $sdr = new DoubleRedirectsPage();
102 -
103 - return $sdr->doQuery( $offset, $limit );
104 -
105 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialListredirects.php
@@ -14,7 +14,10 @@
1515 */
1616 class ListredirectsPage extends QueryPage {
1717
18 - function getName() { return 'Listredirects'; }
 18+ function __construct() {
 19+ SpecialPage::__construct( 'Listredirects' );
 20+ }
 21+
1922 // inexpensive?
2023 function isExpensive() { return true; }
2124 function isSyndicated() { return false; }
@@ -78,9 +81,3 @@
7982 }
8083 }
8184 }
82 -
83 -function wfSpecialListredirects() {
84 - list( $limit, $offset ) = wfCheckLimits();
85 - $lrp = new ListredirectsPage();
86 - $lrp->doQuery( $offset, $limit );
87 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedpages.php
@@ -12,8 +12,8 @@
1313 class UncategorizedPagesPage extends PageQueryPage {
1414 var $requestedNamespace = false;
1515
16 - function getName() {
17 - return "Uncategorizedpages";
 16+ function __construct() {
 17+ SpecialPage::__construct( 'Uncategorizedpages' );
1818 }
1919
2020 function sortDescending() {
@@ -50,14 +50,3 @@
5151 return array( 'page_title' );
5252 }
5353 }
54 -
55 -/**
56 - * constructor
57 - */
58 -function wfSpecialUncategorizedpages() {
59 - list( $limit, $offset ) = wfCheckLimits();
60 -
61 - $lpp = new UncategorizedPagesPage();
62 -
63 - return $lpp->doQuery( $offset, $limit );
64 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialFewestrevisions.php
@@ -12,10 +12,10 @@
1313 */
1414 class FewestrevisionsPage extends QueryPage {
1515
16 - function getName() {
17 - return 'Fewestrevisions';
 16+ function __construct() {
 17+ SpecialPage::__construct( 'Fewestrevisions' );
1818 }
19 -
 19+
2020 function isExpensive() {
2121 return true;
2222 }
@@ -66,9 +66,3 @@
6767 return wfSpecialList( $plink, $nlink );
6868 }
6969 }
70 -
71 -function wfSpecialFewestrevisions() {
72 - list( $limit, $offset ) = wfCheckLimits();
73 - $frp = new FewestrevisionsPage();
74 - $frp->doQuery( $offset, $limit );
75 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php
@@ -16,8 +16,8 @@
1717 */
1818 class WantedTemplatesPage extends WantedQueryPage {
1919
20 - function getName() {
21 - return 'Wantedtemplates';
 20+ function __construct() {
 21+ SpecialPage::__construct( 'Wantedtemplates' );
2222 }
2323
2424 function getQueryInfo() {
@@ -36,14 +36,3 @@
3737 );
3838 }
3939 }
40 -
41 -/**
42 - * constructor
43 - */
44 -function wfSpecialWantedTemplates() {
45 - list( $limit, $offset ) = wfCheckLimits();
46 -
47 - $wpp = new WantedTemplatesPage();
48 -
49 - $wpp->doQuery( $offset, $limit );
50 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedcategories.php
@@ -12,8 +12,8 @@
1313 // inexpensive?
1414 function isExpensive() { return true; }
1515
16 - function getName() {
17 - return 'Unusedcategories';
 16+ function __construct() {
 17+ SpecialPage::__construct( 'Unusedcategories' );
1818 }
1919
2020 function getPageHeader() {
@@ -39,10 +39,3 @@
4040 return $skin->makeKnownLinkObj( $title, $title->getText() );
4141 }
4242 }
43 -
44 -/** constructor */
45 -function wfSpecialUnusedCategories() {
46 - list( $limit, $offset ) = wfCheckLimits();
47 - $uc = new UnusedCategoriesPage();
48 - return $uc->doQuery( $offset, $limit );
49 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialShortpages.php
@@ -11,8 +11,8 @@
1212 */
1313 class ShortPagesPage extends QueryPage {
1414
15 - function getName() {
16 - return 'Shortpages';
 15+ function __construct() {
 16+ SpecialPage::__construct( 'Shortpages' );
1717 }
1818
1919 // inexpensive?
@@ -40,12 +40,7 @@
4141 }
4242
4343 function getOrderFields() {
44 - // For some crazy reason ordering by a constant
45 - // causes a filesort
46 - if( count( MWNamespace::getContentNamespaces() ) > 1 )
47 - return array( 'page_namespace', 'page_title' );
48 - else
49 - return array( 'page_title' );
 44+ return array( 'page_len' );
5045 }
5146
5247 function preprocessResults( $db, $res ) {
@@ -84,14 +79,3 @@
8580 : "({$hlink}) {$dm}{$plink} {$dm}[{$size}]";
8681 }
8782 }
88 -
89 -/**
90 - * constructor
91 - */
92 -function wfSpecialShortpages() {
93 - list( $limit, $offset ) = wfCheckLimits();
94 -
95 - $spp = new ShortPagesPage();
96 -
97 - return $spp->doQuery( $offset, $limit );
98 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialDisambiguations.php
@@ -9,8 +9,8 @@
1010 */
1111 class DisambiguationsPage extends PageQueryPage {
1212
13 - function getName() {
14 - return 'Disambiguations';
 13+ function __construct() {
 14+ SpecialPage::__construct( 'Disambiguations' );
1515 }
1616
1717 function isExpensive() { return true; }
@@ -76,7 +76,7 @@
7777 }
7878
7979 function getOrderFields() {
80 - return array('tl_namespace', 'tl_title', 'value');
 80+ return array( 'tl_namespace', 'tl_title', 'value' );
8181 }
8282
8383 function sortDescending() {
@@ -112,14 +112,3 @@
113113 return "$from $edit $arr $to";
114114 }
115115 }
116 -
117 -/**
118 - * Constructor
119 - */
120 -function wfSpecialDisambiguations() {
121 - list( $limit, $offset ) = wfCheckLimits();
122 -
123 - $sd = new DisambiguationsPage();
124 -
125 - return $sd->doQuery( $offset, $limit );
126 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedtemplates.php
@@ -14,20 +14,8 @@
1515 class UncategorizedTemplatesPage extends UncategorizedPagesPage {
1616
1717 var $requestedNamespace = NS_TEMPLATE;
18 -
19 - public function getName() {
20 - return 'Uncategorizedtemplates';
 18+
 19+ public function __construct() {
 20+ SpecialPage::__construct( 'Uncategorizedtemplates' );
2121 }
22 -
2322 }
24 -
25 -/**
26 - * Main execution point
27 - *
28 - * @param mixed $par Parameter passed to the page
29 - */
30 -function wfSpecialUncategorizedtemplates() {
31 - list( $limit, $offset ) = wfCheckLimits();
32 - $utp = new UncategorizedTemplatesPage();
33 - $utp->doQuery( $offset, $limit );
34 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialMostrevisions.php
@@ -8,23 +8,12 @@
99 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
1010 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1111 */
12 -
13 -/**
14 - * @ingroup SpecialPage
15 - */
1612 class MostrevisionsPage extends FewestrevisionsPage {
 13+ function __construct() {
 14+ SpecialPage::__construct( 'Mostrevisions' );
 15+ }
 16+
1717 function sortDescending() {
1818 return true;
1919 }
2020 }
21 -
22 -/**
23 - * constructor
24 - */
25 -function wfSpecialMostrevisions() {
26 - list( $limit, $offset ) = wfCheckLimits();
27 -
28 - $wpp = new MostrevisionsPage();
29 -
30 - $wpp->doQuery( $offset, $limit );
31 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -12,10 +12,10 @@
1313 class BrokenRedirectsPage extends PageQueryPage {
1414 var $targets = array();
1515
16 - function getName() {
17 - return 'BrokenRedirects';
 16+ function __construct() {
 17+ SpecialPage::__construct( 'BrokenRedirects' );
1818 }
19 -
 19+
2020 // inexpensive?
2121 function isExpensive() { return true; }
2222 function isSyndicated() { return false; }
@@ -87,14 +87,3 @@
8888 return $out;
8989 }
9090 }
91 -
92 -/**
93 - * constructor
94 - */
95 -function wfSpecialBrokenRedirects() {
96 - list( $limit, $offset ) = wfCheckLimits();
97 -
98 - $sbr = new BrokenRedirectsPage();
99 -
100 - return $sbr->doQuery( $offset, $limit );
101 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedcategories.php
@@ -15,8 +15,8 @@
1616 */
1717 class WantedCategoriesPage extends WantedQueryPage {
1818
19 - function getName() {
20 - return 'Wantedcategories';
 19+ function __construct() {
 20+ SpecialPage::__construct( 'Wantedcategories' );
2121 }
2222
2323 function getQueryInfo() {
@@ -48,14 +48,3 @@
4949 return wfSpecialList($plink, $nlinks);
5050 }
5151 }
52 -
53 -/**
54 - * constructor
55 - */
56 -function wfSpecialWantedCategories() {
57 - list( $limit, $offset ) = wfCheckLimits();
58 -
59 - $wpp = new WantedCategoriesPage();
60 -
61 - $wpp->doQuery( $offset, $limit );
62 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedimages.php
@@ -13,10 +13,10 @@
1414 // inexpensive?
1515 function isExpensive() { return true; }
1616
17 - function getName() {
18 - return 'Unusedimages';
 17+ function __construct() {
 18+ SpecialPage::__construct( 'Unusedimages' );
1919 }
20 -
 20+
2121 function sortDescending() {
2222 return false;
2323 }
@@ -62,13 +62,3 @@
6363 }
6464
6565 }
66 -
67 -/**
68 - * Entry point
69 - */
70 -function wfSpecialUnusedimages() {
71 - list( $limit, $offset ) = wfCheckLimits();
72 - $uip = new UnusedimagesPage();
73 -
74 - return $uip->doQuery( $offset, $limit );
75 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialWithoutinterwiki.php
@@ -13,9 +13,19 @@
1414 class WithoutInterwikiPage extends PageQueryPage {
1515 private $prefix = '';
1616
17 - function getName() {
18 - return 'Withoutinterwiki';
 17+ function __construct() {
 18+ SpecialPage::__construct( 'Withoutinterwiki' );
1919 }
 20+
 21+ function execute( $par ) {
 22+ global $wgRequest, $wgContLang, $wgCapitalLinks;
 23+ $prefix = $wgRequest->getVal( 'prefix', $par );
 24+ if( $wgCapitalLinks ) {
 25+ $prefix = $wgContLang->ucfirst( $prefix );
 26+ }
 27+ $this->prefix = $prefix;
 28+ parent::execute( $par );
 29+ }
2030
2131 function getPageHeader() {
2232 global $wgScript, $wgMiserMode;
@@ -77,18 +87,8 @@
7888 function setPrefix( $prefix = '' ) {
7989 $this->prefix = $prefix;
8090 }
81 -
82 -}
83 -
84 -function wfSpecialWithoutinterwiki() {
85 - global $wgRequest, $wgContLang, $wgCapitalLinks;
86 - list( $limit, $offset ) = wfCheckLimits();
87 - if( $wgCapitalLinks ) {
88 - $prefix = $wgContLang->ucfirst( $wgRequest->getVal( 'prefix' ) );
89 - } else {
90 - $prefix = $wgRequest->getVal( 'prefix' );
 91+
 92+ function linkParameters() {
 93+ return array( 'prefix' => $this->prefix );
9194 }
92 - $wip = new WithoutInterwikiPage();
93 - $wip->setPrefix( $prefix );
94 - $wip->doQuery( $offset, $limit );
9595 }
Index: branches/querypage-work/phase3/includes/specials/SpecialAncientpages.php
@@ -10,8 +10,8 @@
1111 */
1212 class AncientPagesPage extends QueryPage {
1313
14 - function getName() {
15 - return "Ancientpages";
 14+ function __construct() {
 15+ SpecialPage::__construct( 'Ancientpages' );
1616 }
1717
1818 function isExpensive() {
@@ -49,11 +49,3 @@
5050 return wfSpecialList( $link, $d );
5151 }
5252 }
53 -
54 -function wfSpecialAncientpages() {
55 - list( $limit, $offset ) = wfCheckLimits();
56 -
57 - $app = new AncientPagesPage();
58 -
59 - $app->doQuery( $offset, $limit );
60 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialDeadendpages.php
@@ -9,8 +9,8 @@
1010 */
1111 class DeadendPagesPage extends PageQueryPage {
1212
13 - function getName() {
14 - return "Deadendpages";
 13+ function __construct() {
 14+ SpecialPage::__construct( 'Deadendpages' );
1515 }
1616
1717 function getPageHeader() {
@@ -62,15 +62,3 @@
6363 return array( 'page_title' );
6464 }
6565 }
66 -
67 -/**
68 - * Constructor
69 - */
70 -function wfSpecialDeadendpages() {
71 -
72 - list( $limit, $offset ) = wfCheckLimits();
73 -
74 - $depp = new DeadendPagesPage();
75 -
76 - return $depp->doQuery( $offset, $limit );
77 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedfiles.php
@@ -15,8 +15,8 @@
1616 */
1717 class WantedFilesPage extends WantedQueryPage {
1818
19 - function getName() {
20 - return 'Wantedfiles';
 19+ function __construct() {
 20+ SpecialPage::__construct( 'Wantedfiles' );
2121 }
2222
2323 function getQueryInfo() {
@@ -33,14 +33,3 @@
3434 );
3535 }
3636 }
37 -
38 -/**
39 - * constructor
40 - */
41 -function wfSpecialWantedFiles() {
42 - list( $limit, $offset ) = wfCheckLimits();
43 -
44 - $wpp = new WantedFilesPage();
45 -
46 - $wpp->doQuery( $offset, $limit );
47 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinked.php
@@ -18,7 +18,10 @@
1919 */
2020 class MostlinkedPage extends QueryPage {
2121
22 - function getName() { return 'Mostlinked'; }
 22+ function __construct() {
 23+ SpecialPage::__construct( 'Mostlinked' );
 24+ }
 25+
2326 function isExpensive() { return true; }
2427 function isSyndicated() { return false; }
2528
@@ -83,14 +86,3 @@
8487 return wfSpecialList( $link, $wlh );
8588 }
8689 }
87 -
88 -/**
89 - * constructor
90 - */
91 -function wfSpecialMostlinked() {
92 - list( $limit, $offset ) = wfCheckLimits();
93 -
94 - $wpp = new MostlinkedPage();
95 -
96 - $wpp->doQuery( $offset, $limit );
97 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedcategories.php
@@ -15,7 +15,10 @@
1616 */
1717 class MostlinkedCategoriesPage extends QueryPage {
1818
19 - function getName() { return 'Mostlinkedcategories'; }
 19+ function __construct() {
 20+ SpecialPage::__construct( 'Mostlinkedcategories' );
 21+ }
 22+
2023 function isExpensive() { return true; }
2124 function isSyndicated() { return false; }
2225
@@ -59,14 +62,3 @@
6063 return wfSpecialList($plink, $nlinks);
6164 }
6265 }
63 -
64 -/**
65 - * constructor
66 - */
67 -function wfSpecialMostlinkedCategories() {
68 - list( $limit, $offset ) = wfCheckLimits();
69 -
70 - $wpp = new MostlinkedCategoriesPage();
71 -
72 - $wpp->doQuery( $offset, $limit );
73 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialLongpages.php
@@ -10,22 +10,11 @@
1111 */
1212 class LongPagesPage extends ShortPagesPage {
1313
14 - function getName() {
15 - return "Longpages";
 14+ function __construct() {
 15+ SpecialPage::__construct( 'Longpages' );
1616 }
1717
1818 function sortDescending() {
1919 return true;
2020 }
2121 }
22 -
23 -/**
24 - * constructor
25 - */
26 -function wfSpecialLongpages() {
27 - list( $limit, $offset ) = wfCheckLimits();
28 -
29 - $lpp = new LongPagesPage();
30 -
31 - $lpp->doQuery( $offset, $limit );
32 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialLonelypages.php
@@ -11,9 +11,10 @@
1212 */
1313 class LonelyPagesPage extends PageQueryPage {
1414
15 - function getName() {
16 - return "Lonelypages";
 15+ function __construct() {
 16+ SpecialPage::__construct( 'Lonelypages' );
1717 }
 18+
1819 function getPageHeader() {
1920 return wfMsgExt( 'lonelypagestext', array( 'parse' ) );
2021 }
@@ -60,14 +61,3 @@
6162 return array( 'page_title' );
6263 }
6364 }
64 -
65 -/**
66 - * Constructor
67 - */
68 -function wfSpecialLonelypages() {
69 - list( $limit, $offset ) = wfCheckLimits();
70 -
71 - $lpp = new LonelyPagesPage();
72 -
73 - return $lpp->doQuery( $offset, $limit );
74 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialLinkSearch.php
@@ -11,79 +11,77 @@
1212 * Special:LinkSearch to search the external-links table.
1313 * @ingroup SpecialPage
1414 */
15 -
16 -function wfSpecialLinkSearch( $par ) {
17 -
18 - list( $limit, $offset ) = wfCheckLimits();
19 - global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang;
20 - $target = $GLOBALS['wgRequest']->getVal( 'target', $par );
21 - $namespace = $GLOBALS['wgRequest']->getIntorNull( 'namespace', null );
22 -
23 - $protocols_list[] = '';
24 - foreach( $wgUrlProtocols as $prot ) {
25 - $protocols_list[] = $prot;
 15+class LinkSearchPage extends QueryPage {
 16+ function setParams( $params ) {
 17+ $this->mQuery = $params['query'];
 18+ $this->mNs = $params['namespace'];
 19+ $this->mProt = $params['protocol'];
2620 }
2721
28 - $target2 = $target;
29 - $protocol = '';
30 - $pr_sl = strpos($target2, '//' );
31 - $pr_cl = strpos($target2, ':' );
32 - if ( $pr_sl ) {
33 - // For protocols with '//'
34 - $protocol = substr( $target2, 0 , $pr_sl+2 );
35 - $target2 = substr( $target2, $pr_sl+2 );
36 - } elseif ( !$pr_sl && $pr_cl ) {
37 - // For protocols without '//' like 'mailto:'
38 - $protocol = substr( $target2, 0 , $pr_cl+1 );
39 - $target2 = substr( $target2, $pr_cl+1 );
40 - } elseif ( $protocol == '' && $target2 != '' ) {
41 - // default
42 - $protocol = 'http://';
 22+ function __construct() {
 23+ SpecialPage::__construct( 'LinkSearch' );
4324 }
44 - if ( !in_array( $protocol, $protocols_list ) ) {
45 - // unsupported protocol, show original search request
 25+
 26+ function execute( $par ) {
 27+ global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang, $wgScript;
 28+ $target = $wgRequest->getVal( 'target', $par );
 29+ $namespace = $wgRequest->getIntorNull( 'namespace', null );
 30+
 31+ $protocols_list[] = '';
 32+ foreach( $wgUrlProtocols as $prot ) {
 33+ $protocols_list[] = $prot;
 34+ }
 35+
4636 $target2 = $target;
4737 $protocol = '';
48 - }
 38+ $pr_sl = strpos($target2, '//' );
 39+ $pr_cl = strpos($target2, ':' );
 40+ if ( $pr_sl ) {
 41+ // For protocols with '//'
 42+ $protocol = substr( $target2, 0 , $pr_sl+2 );
 43+ $target2 = substr( $target2, $pr_sl+2 );
 44+ } elseif ( !$pr_sl && $pr_cl ) {
 45+ // For protocols without '//' like 'mailto:'
 46+ $protocol = substr( $target2, 0 , $pr_cl+1 );
 47+ $target2 = substr( $target2, $pr_cl+1 );
 48+ } elseif ( $protocol == '' && $target2 != '' ) {
 49+ // default
 50+ $protocol = 'http://';
 51+ }
 52+ if ( !in_array( $protocol, $protocols_list ) ) {
 53+ // unsupported protocol, show original search request
 54+ $target2 = $target;
 55+ $protocol = '';
 56+ }
4957
50 - $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' );
 58+ $self = $this->getTitle();
5159
52 - $wgOut->addWikiText( wfMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols) . '</nowiki>' ) );
53 - $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
54 - Xml::hidden( 'title', $self->getPrefixedDbKey() ) .
55 - '<fieldset>' .
56 - Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) .
57 - Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' ';
58 - if ( !$wgMiserMode ) {
59 - $s .= Xml::label( wfMsg( 'linksearch-ns' ), 'namespace' ) . ' ' .
60 - XML::namespaceSelector( $namespace, '' );
61 - }
62 - $s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) .
63 - '</fieldset>' .
64 - Xml::closeElement( 'form' );
65 - $wgOut->addHTML( $s );
 60+ $wgOut->addWikiText( wfMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' ) );
 61+ $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript ) ) .
 62+ Xml::hidden( 'title', $self->getPrefixedDbKey() ) .
 63+ '<fieldset>' .
 64+ Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) .
 65+ Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' ';
 66+ if ( !$wgMiserMode ) {
 67+ $s .= Xml::label( wfMsg( 'linksearch-ns' ), 'namespace' ) . ' ' .
 68+ Xml::namespaceSelector( $namespace, '' );
 69+ }
 70+ $s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) .
 71+ '</fieldset>' .
 72+ Xml::closeElement( 'form' );
 73+ $wgOut->addHTML( $s );
6674
67 - if( $target != '' ) {
68 - $searcher = new LinkSearchPage;
69 - $searcher->setParams( array(
70 - 'query' => $target2,
71 - 'namespace' => $namespace,
72 - 'protocol' => $protocol ) );
73 - $searcher->doQuery( $offset, $limit );
 75+ if( $target != '' ) {
 76+ $this->setParams( array(
 77+ 'query' => $target2,
 78+ 'namespace' => $namespace,
 79+ 'protocol' => $protocol ) );
 80+ parent::execute( $par );
 81+ if( $this->mMungedQuery === false )
 82+ $wgOut->addWikiText( wfMsg( 'linksearch-error' ) );
 83+ }
7484 }
75 -}
7685
77 -class LinkSearchPage extends QueryPage {
78 - function setParams( $params ) {
79 - $this->mQuery = $params['query'];
80 - $this->mNs = $params['namespace'];
81 - $this->mProt = $params['protocol'];
82 - }
83 -
84 - function getName() {
85 - return 'LinkSearch';
86 - }
87 -
8886 /**
8987 * Disable RSS/Atom feeds
9088 */
@@ -122,9 +120,13 @@
123121 $dbr = wfGetDB( DB_SLAVE );
124122 // strip everything past first wildcard, so that
125123 // index-based-only lookup would be done
126 - list( $munged, $clause ) = self::mungeQuery( $this->mQuery,
127 - $this->mProt );
128 - $stripped = substr( $munged, 0, strpos( $munged, '%' ) + 1 );
 124+ list( $this->mMungedQuery, $clause ) = self::mungeQuery(
 125+ $this->mQuery, $this->mProt );
 126+ if( $this->mMungedQuery === false )
 127+ // Invalid query; return no results
 128+ return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' );
 129+
 130+ $stripped = substr( $this->mMungedQuery, 0, strpos( $this->mMungedQuery, '%' ) + 1 );
129131 $encSearch = $dbr->addQuotes( $stripped );
130132 $retval = array (
131133 'tables' => array ( 'page', 'externallinks' ),
@@ -151,28 +153,12 @@
152154 }
153155
154156 /**
155 - * Override to check query validity.
156 - */
157 - function doQuery( $offset, $limit, $shownavigation=true ) {
158 - global $wgOut;
159 - list( $this->mMungedQuery, $clause ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
160 - if( $this->mMungedQuery === false ) {
161 - $wgOut->addWikiText( wfMsg( 'linksearch-error' ) );
162 - } else {
163 - // For debugging
164 - // Generates invalid xhtml with patterns that contain --
165 - //$wgOut->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
166 - parent::doQuery( $offset, $limit, $shownavigation );
167 - }
168 - }
169 -
170 - /**
171157 * Override to squash the ORDER BY.
172158 * We do a truncated index search, so the optimizer won't trust
173159 * it as good enough for optimizing sort. The implicit ordering
174160 * from the scan will usually do well enough for our needs.
175161 */
176 - function getOrder() {
177 - return '';
 162+ function getOrderFields() {
 163+ return array();
178164 }
179165 }
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedtemplates.php
@@ -11,40 +11,19 @@
1212 * @ingroup SpecialPage
1313 * @author Rob Church <robchur@gmail.com>
1414 */
15 -class SpecialMostlinkedtemplates extends QueryPage {
16 -
17 - /**
18 - * Name of the report
19 - *
20 - * @return string
21 - */
22 - public function getName() {
23 - return 'Mostlinkedtemplates';
 15+class MostlinkedTemplatesPage extends QueryPage {
 16+ public function __construct() {
 17+ SpecialPage::__construct( 'Mostlinkedtemplates' );
2418 }
2519
26 - /**
27 - * Is this report expensive, i.e should it be cached?
28 - *
29 - * @return bool
30 - */
3120 public function isExpensive() {
3221 return true;
3322 }
3423
35 - /**
36 - * Is there a feed available?
37 - *
38 - * @return bool
39 - */
4024 public function isSyndicated() {
4125 return false;
4226 }
4327
44 - /**
45 - * Sort the results in descending order?
46 - *
47 - * @return bool
48 - */
4928 public function sortDescending() {
5029 return true;
5130 }
@@ -76,13 +55,6 @@
7756 $db->dataSeek( $res, 0 );
7857 }
7958
80 - /**
81 - * Format a result row
82 - *
83 - * @param Skin $skin Skin to use for UI elements
84 - * @param object $result Result row
85 - * @return string
86 - */
8759 public function formatResult( $skin, $result ) {
8860 $title = Title::makeTitle( $result->namespace, $result->title );
8961
@@ -109,14 +81,3 @@
11082 return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) );
11183 }
11284 }
113 -
114 -/**
115 - * Execution function
116 - *
117 - * @param mixed $par Parameters passed to the page
118 - */
119 -function wfSpecialMostlinkedtemplates( $par = false ) {
120 - list( $limit, $offset ) = wfCheckLimits();
121 - $mlt = new SpecialMostlinkedtemplates();
122 - $mlt->doQuery( $offset, $limit );
123 -}
Index: branches/querypage-work/phase3/includes/specials/SpecialUncategorizedcategories.php
@@ -9,22 +9,9 @@
1010 * @ingroup SpecialPage
1111 */
1212 class UncategorizedCategoriesPage extends UncategorizedPagesPage {
13 - function UncategorizedCategoriesPage() {
14 - $this->requestedNamespace = NS_CATEGORY;
 13+ var $requestedNamespace = NS_CATEGORY;
 14+
 15+ function __construct() {
 16+ SpecialPage::__construct( 'Uncategorizedcategories' );
1517 }
16 -
17 - function getName() {
18 - return "Uncategorizedcategories";
19 - }
2018 }
21 -
22 -/**
23 - * constructor
24 - */
25 -function wfSpecialUncategorizedcategories() {
26 - list( $limit, $offset ) = wfCheckLimits();
27 -
28 - $lpp = new UncategorizedCategoriesPage();
29 -
30 - return $lpp->doQuery( $offset, $limit );
31 -}
Index: branches/querypage-work/phase3/includes/AutoLoader.php
@@ -480,6 +480,7 @@
481481 'MostimagesPage' => 'includes/specials/SpecialMostimages.php',
482482 'MostlinkedCategoriesPage' => 'includes/specials/SpecialMostlinkedcategories.php',
483483 'MostlinkedPage' => 'includes/specials/SpecialMostlinked.php',
 484+ 'MostlinkedTemplatesPage' => 'includes/specials/SpecialMostlinkedtemplates.php',
484485 'MostrevisionsPage' => 'includes/specials/SpecialMostrevisions.php',
485486 'MovePageForm' => 'includes/specials/SpecialMovepage.php',
486487 'SpecialNewpages' => 'includes/specials/SpecialNewpages.php',
@@ -498,7 +499,6 @@
499500 'SpecialExport' => 'includes/specials/SpecialExport.php',
500501 'SpecialImport' => 'includes/specials/SpecialImport.php',
501502 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php',
502 - 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
503503 'SpecialPreferences' => 'includes/specials/SpecialPreferences.php',
504504 'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
505505 'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php',
@@ -511,6 +511,7 @@
512512 'SpecialVersion' => 'includes/specials/SpecialVersion.php',
513513 'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php',
514514 'UncategorizedCategoriesPage' => 'includes/specials/SpecialUncategorizedcategories.php',
 515+ 'UncategorizedImagesPage' => 'includes/specials/SpecialUncategorizedimages.php',
515516 'UncategorizedPagesPage' => 'includes/specials/SpecialUncategorizedpages.php',
516517 'UncategorizedTemplatesPage' => 'includes/specials/SpecialUncategorizedtemplates.php',
517518 'UndeleteForm' => 'includes/specials/SpecialUndelete.php',
Index: branches/querypage-work/phase3/includes/SpecialPage.php
@@ -81,39 +81,39 @@
8282 */
8383 static public $mList = array(
8484 # Maintenance Reports
85 - 'BrokenRedirects' => array( 'SpecialPage', 'BrokenRedirects' ),
86 - 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ),
87 - 'DoubleRedirects' => array( 'SpecialPage', 'DoubleRedirects' ),
88 - 'Longpages' => array( 'SpecialPage', 'Longpages' ),
89 - 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ),
90 - 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
91 - 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ),
92 - 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ),
 85+ 'BrokenRedirects' => array( 'BrokenRedirectsPage' ),
 86+ 'Deadendpages' => array( 'DeadendpagesPage' ),
 87+ 'DoubleRedirects' => array( 'DoubleRedirectsPage' ),
 88+ 'Longpages' => array( 'LongpagesPage' ),
 89+ 'Ancientpages' => array( 'AncientpagesPage' ),
 90+ 'Lonelypages' => array( 'LonelypagesPage' ),
 91+ 'Fewestrevisions' => array( 'FewestrevisionsPage' ),
 92+ 'Withoutinterwiki' => array( 'WithoutinterwikiPage' ),
9393 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ),
94 - 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ),
95 - 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
96 - 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
97 - 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
98 - 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
99 - 'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ),
100 - 'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ),
101 - 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
102 - 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ),
103 - 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
104 - 'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ),
105 - 'Wantedfiles' => array( 'SpecialPage', 'Wantedfiles' ),
106 - 'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ),
107 - 'Wantedtemplates' => array( 'SpecialPage', 'Wantedtemplates' ),
 94+ 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ),
 95+ 'Shortpages' => array( 'ShortpagesPage' ),
 96+ 'Uncategorizedcategories' => array( 'UncategorizedcategoriesPage' ),
 97+ 'Uncategorizedimages' => array( 'UncategorizedImagesPage' ),
 98+ 'Uncategorizedpages' => array( 'UncategorizedpagesPage' ),
 99+ 'Uncategorizedtemplates' => array( 'UncategorizedtemplatesPage' ),
 100+ 'Unusedcategories' => array( 'UnusedcategoriesPage' ),
 101+ 'Unusedimages' => array( 'UnusedimagesPage' ),
 102+ 'Unusedtemplates' => array( 'UnusedtemplatesPage' ),
 103+ 'Unwatchedpages' => array( 'UnwatchedpagesPage' ),
 104+ 'Wantedcategories' => array( 'WantedcategoriesPage' ),
 105+ 'Wantedfiles' => array( 'WantedfilesPage' ),
 106+ 'Wantedpages' => array( 'WantedpagesPage' ),
 107+ 'Wantedtemplates' => array( 'WantedtemplatesPage' ),
108108
109109 # List of pages
110 - 'Allpages' => 'SpecialAllpages',
111 - 'Prefixindex' => 'SpecialPrefixindex',
 110+ 'Allpages' => 'SpecialAllpages',
 111+ 'Prefixindex' => 'SpecialPrefixindex',
112112 'Categories' => array( 'SpecialPage', 'Categories' ),
113 - 'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ),
114 - 'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
 113+ 'Disambiguations' => array( 'DisambiguationsPage' ),
 114+ 'Listredirects' => array( 'ListredirectsPage' ),
115115
116116 # Login/create account
117 - 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
 117+ 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
118118 'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ),
119119
120120 # Users and rights
@@ -156,12 +156,12 @@
157157 'Randomredirect' => 'SpecialRandomredirect',
158158
159159 # High use pages
160 - 'Mostlinkedcategories' => array( 'SpecialPage', 'Mostlinkedcategories' ),
161 - 'Mostimages' => array( 'SpecialPage', 'Mostimages' ),
162 - 'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ),
163 - 'Mostlinkedtemplates' => array( 'SpecialPage', 'Mostlinkedtemplates' ),
164 - 'Mostcategories' => array( 'SpecialPage', 'Mostcategories' ),
165 - 'Mostrevisions' => array( 'SpecialPage', 'Mostrevisions' ),
 160+ 'Mostlinkedcategories' => array( 'MostlinkedCategoriesPage' ),
 161+ 'Mostimages' => array( 'MostimagesPage' ),
 162+ 'Mostlinked' => array( 'MostlinkedPage' ),
 163+ 'Mostlinkedtemplates' => array( 'MostlinkedTemplatesPage' ),
 164+ 'Mostcategories' => array( 'MostcategoriesPage' ),
 165+ 'Mostrevisions' => array( 'MostrevisionsPage' ),
166166
167167 # Page tools
168168 'Export' => 'SpecialExport',
@@ -210,7 +210,7 @@
211211 self::$mListInitialised = true;
212212
213213 if( !$wgDisableCounters ) {
214 - self::$mList['Popularpages'] = array( 'SpecialPage', 'Popularpages' );
 214+ self::$mList['Popularpages'] = array( 'PopularpagesPage' );
215215 }
216216
217217 if( !$wgDisableInternalSearch ) {
Index: branches/querypage-work/phase3/includes/QueryPage.php
@@ -28,7 +28,7 @@
2929 array( 'MostcategoriesPage', 'Mostcategories' ),
3030 array( 'MostimagesPage', 'Mostimages' ),
3131 array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ),
32 - array( 'SpecialMostlinkedtemplates', 'Mostlinkedtemplates' ),
 32+ array( 'MostlinkedTemplatesPage', 'Mostlinkedtemplates' ),
3333 array( 'MostlinkedPage', 'Mostlinked' ),
3434 array( 'MostrevisionsPage', 'Mostrevisions' ),
3535 array( 'FewestrevisionsPage', 'Fewestrevisions' ),
@@ -91,15 +91,6 @@
9292 }
9393
9494 /**
95 - * Return title object representing this page
96 - *
97 - * @return Title
98 - */
99 - function getTitle() {
100 - return SpecialPage::getTitleFor( $this->getName() );
101 - }
102 -
103 - /**
10495 * Subclasses return an SQL query here, formatted as an array with the
10596 * following keys:
10697 * tables => Table(s) for passing to Database::select()
@@ -367,7 +358,8 @@
368359 function execute( $par ) {
369360 global $wgUser, $wgOut, $wgLang;
370361
371 - list( $this->limit, $this->offset ) = wfCheckLimits();
 362+ if( $this->limit == 0 && $this->offset == 0 )
 363+ list( $this->limit, $this->offset ) = wfCheckLimits();
372364 $sname = $this->getName();
373365 $fname = get_class( $this ) . '::doQuery';
374366 $dbr = wfGetDB( DB_SLAVE );

Follow-up revisions

RevisionCommit summaryAuthorDate
r65326querypage-work2: Merge r51597reedy14:32, 20 April 2010

Status & tagging log