Index: branches/querypage-work/phase3/includes/specials/SpecialUnusedtemplates.php |
— | — | @@ -13,7 +13,10 @@ |
14 | 14 | */ |
15 | 15 | class UnusedtemplatesPage extends QueryPage { |
16 | 16 | |
17 | | - function getName() { return( 'Unusedtemplates' ); } |
| 17 | + function __construct() { |
| 18 | + SpecialPage::__construct( 'Unusedtemplates' ); |
| 19 | + } |
| 20 | + |
18 | 21 | // inexpensive? |
19 | 22 | function isExpensive() { return true; } |
20 | 23 | function isSyndicated() { return false; } |
— | — | @@ -50,8 +53,3 @@ |
51 | 54 | |
52 | 55 | } |
53 | 56 | |
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 @@ |
15 | 15 | */ |
16 | 16 | class MostcategoriesPage extends QueryPage { |
17 | 17 | |
18 | | - function getName() { return 'Mostcategories'; } |
| 18 | + function __construct() { |
| 19 | + SpecialPage::__construct( 'Mostcategories' ); |
| 20 | + } |
| 21 | + |
19 | 22 | function isExpensive() { return true; } |
20 | 23 | function isSyndicated() { return false; } |
21 | 24 | |
— | — | @@ -41,14 +44,3 @@ |
42 | 45 | return wfSpecialList( $link, $count ); |
43 | 46 | } |
44 | 47 | } |
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 @@ |
14 | 14 | // FIXME: Use an instance of UncategorizedPagesPage or something |
15 | 15 | class UncategorizedImagesPage extends ImageQueryPage { |
16 | 16 | |
17 | | - function getName() { |
18 | | - return 'Uncategorizedimages'; |
| 17 | + function __construct() { |
| 18 | + SpecialPage::__construct( 'Uncategorizedimages' ); |
19 | 19 | } |
20 | 20 | |
21 | 21 | function sortDescending() { |
— | — | @@ -45,9 +45,3 @@ |
46 | 46 | } |
47 | 47 | |
48 | 48 | } |
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 @@ |
12 | 12 | class WantedPagesPage extends WantedQueryPage { |
13 | 13 | var $nlinks; |
14 | 14 | |
15 | | - function WantedPagesPage( $inc = false, $nlinks = true ) { |
16 | | - $this->setListoutput( $inc ); |
17 | | - $this->nlinks = $nlinks; |
| 15 | + function __construct() { |
| 16 | + SpecialPage::__construct( 'Wantedpages' ); |
18 | 17 | } |
| 18 | + |
| 19 | + function execute( $par ) { |
| 20 | + $inc = $this->including(); |
19 | 21 | |
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 ); |
22 | 34 | } |
23 | 35 | |
24 | 36 | function getSQL() { |
— | — | @@ -74,24 +86,3 @@ |
75 | 87 | return $query; |
76 | 88 | } |
77 | 89 | } |
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 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * @file |
5 | | - * @ingroup SpecialPage |
6 | | - */ |
7 | | - |
8 | | -/** |
9 | 4 | * implements Special:Popularpages |
10 | 5 | * @ingroup SpecialPage |
11 | 6 | */ |
12 | 7 | class PopularPagesPage extends QueryPage { |
13 | 8 | |
14 | | - function getName() { |
15 | | - return "Popularpages"; |
| 9 | + function __construct() { |
| 10 | + SpecialPage::__construct( 'Popularpages' ); |
16 | 11 | } |
17 | 12 | |
18 | 13 | function isExpensive() { |
— | — | @@ -39,14 +34,3 @@ |
40 | 35 | return wfSpecialList($link, $nv); |
41 | 36 | } |
42 | 37 | } |
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 @@ |
16 | 16 | */ |
17 | 17 | class UnwatchedpagesPage extends QueryPage { |
18 | 18 | |
19 | | - function getName() { return 'Unwatchedpages'; } |
| 19 | + function __construct() { |
| 20 | + SpecialPage::__construct( 'Unwatchedpages' ); |
| 21 | + } |
| 22 | + |
20 | 23 | // inexpensive? |
21 | 24 | function isExpensive() { return true; } |
22 | 25 | function isSyndicated() { return false; } |
— | — | @@ -40,6 +43,7 @@ |
41 | 44 | |
42 | 45 | function getOrderFields() { |
43 | 46 | return array( 'page_namespace', 'page_title' ); |
| 47 | + } |
44 | 48 | |
45 | 49 | function formatResult( $skin, $result ) { |
46 | 50 | global $wgContLang; |
— | — | @@ -52,20 +56,4 @@ |
53 | 57 | |
54 | 58 | return wfSpecialList( $plink, $wlink ); |
55 | 59 | } |
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 @@ |
15 | 15 | */ |
16 | 16 | class MostimagesPage extends ImageQueryPage { |
17 | 17 | |
18 | | - function getName() { return 'Mostimages'; } |
| 18 | + function __construct() { |
| 19 | + SpecialPage::__construct( 'Mostimages' ); |
| 20 | + } |
| 21 | + |
19 | 22 | function isExpensive() { return true; } |
20 | 23 | function isSyndicated() { return false; } |
21 | 24 | |
— | — | @@ -36,14 +39,3 @@ |
37 | 40 | } |
38 | 41 | |
39 | 42 | } |
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 @@ |
12 | 12 | */ |
13 | 13 | class DoubleRedirectsPage extends PageQueryPage { |
14 | 14 | |
15 | | - function getName() { |
16 | | - return 'DoubleRedirects'; |
| 15 | + function __construct() { |
| 16 | + SpecialPage::__construct( 'DoubleRedirects' ); |
17 | 17 | } |
18 | | - |
| 18 | + |
19 | 19 | // inexpensive? |
20 | 20 | function isExpensive() { return true; } |
21 | 21 | function isSyndicated() { return false; } |
— | — | @@ -90,15 +90,3 @@ |
91 | 91 | return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); |
92 | 92 | } |
93 | 93 | } |
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 @@ |
15 | 15 | */ |
16 | 16 | class ListredirectsPage extends QueryPage { |
17 | 17 | |
18 | | - function getName() { return 'Listredirects'; } |
| 18 | + function __construct() { |
| 19 | + SpecialPage::__construct( 'Listredirects' ); |
| 20 | + } |
| 21 | + |
19 | 22 | // inexpensive? |
20 | 23 | function isExpensive() { return true; } |
21 | 24 | function isSyndicated() { return false; } |
— | — | @@ -78,9 +81,3 @@ |
79 | 82 | } |
80 | 83 | } |
81 | 84 | } |
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 @@ |
13 | 13 | class UncategorizedPagesPage extends PageQueryPage { |
14 | 14 | var $requestedNamespace = false; |
15 | 15 | |
16 | | - function getName() { |
17 | | - return "Uncategorizedpages"; |
| 16 | + function __construct() { |
| 17 | + SpecialPage::__construct( 'Uncategorizedpages' ); |
18 | 18 | } |
19 | 19 | |
20 | 20 | function sortDescending() { |
— | — | @@ -50,14 +50,3 @@ |
51 | 51 | return array( 'page_title' ); |
52 | 52 | } |
53 | 53 | } |
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 @@ |
13 | 13 | */ |
14 | 14 | class FewestrevisionsPage extends QueryPage { |
15 | 15 | |
16 | | - function getName() { |
17 | | - return 'Fewestrevisions'; |
| 16 | + function __construct() { |
| 17 | + SpecialPage::__construct( 'Fewestrevisions' ); |
18 | 18 | } |
19 | | - |
| 19 | + |
20 | 20 | function isExpensive() { |
21 | 21 | return true; |
22 | 22 | } |
— | — | @@ -66,9 +66,3 @@ |
67 | 67 | return wfSpecialList( $plink, $nlink ); |
68 | 68 | } |
69 | 69 | } |
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 @@ |
17 | 17 | */ |
18 | 18 | class WantedTemplatesPage extends WantedQueryPage { |
19 | 19 | |
20 | | - function getName() { |
21 | | - return 'Wantedtemplates'; |
| 20 | + function __construct() { |
| 21 | + SpecialPage::__construct( 'Wantedtemplates' ); |
22 | 22 | } |
23 | 23 | |
24 | 24 | function getQueryInfo() { |
— | — | @@ -36,14 +36,3 @@ |
37 | 37 | ); |
38 | 38 | } |
39 | 39 | } |
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 @@ |
13 | 13 | // inexpensive? |
14 | 14 | function isExpensive() { return true; } |
15 | 15 | |
16 | | - function getName() { |
17 | | - return 'Unusedcategories'; |
| 16 | + function __construct() { |
| 17 | + SpecialPage::__construct( 'Unusedcategories' ); |
18 | 18 | } |
19 | 19 | |
20 | 20 | function getPageHeader() { |
— | — | @@ -39,10 +39,3 @@ |
40 | 40 | return $skin->makeKnownLinkObj( $title, $title->getText() ); |
41 | 41 | } |
42 | 42 | } |
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 @@ |
12 | 12 | */ |
13 | 13 | class ShortPagesPage extends QueryPage { |
14 | 14 | |
15 | | - function getName() { |
16 | | - return 'Shortpages'; |
| 15 | + function __construct() { |
| 16 | + SpecialPage::__construct( 'Shortpages' ); |
17 | 17 | } |
18 | 18 | |
19 | 19 | // inexpensive? |
— | — | @@ -40,12 +40,7 @@ |
41 | 41 | } |
42 | 42 | |
43 | 43 | 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' ); |
50 | 45 | } |
51 | 46 | |
52 | 47 | function preprocessResults( $db, $res ) { |
— | — | @@ -84,14 +79,3 @@ |
85 | 80 | : "({$hlink}) {$dm}{$plink} {$dm}[{$size}]"; |
86 | 81 | } |
87 | 82 | } |
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 @@ |
10 | 10 | */ |
11 | 11 | class DisambiguationsPage extends PageQueryPage { |
12 | 12 | |
13 | | - function getName() { |
14 | | - return 'Disambiguations'; |
| 13 | + function __construct() { |
| 14 | + SpecialPage::__construct( 'Disambiguations' ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | function isExpensive() { return true; } |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | } |
78 | 78 | |
79 | 79 | function getOrderFields() { |
80 | | - return array('tl_namespace', 'tl_title', 'value'); |
| 80 | + return array( 'tl_namespace', 'tl_title', 'value' ); |
81 | 81 | } |
82 | 82 | |
83 | 83 | function sortDescending() { |
— | — | @@ -112,14 +112,3 @@ |
113 | 113 | return "$from $edit $arr $to"; |
114 | 114 | } |
115 | 115 | } |
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 @@ |
15 | 15 | class UncategorizedTemplatesPage extends UncategorizedPagesPage { |
16 | 16 | |
17 | 17 | var $requestedNamespace = NS_TEMPLATE; |
18 | | - |
19 | | - public function getName() { |
20 | | - return 'Uncategorizedtemplates'; |
| 18 | + |
| 19 | + public function __construct() { |
| 20 | + SpecialPage::__construct( 'Uncategorizedtemplates' ); |
21 | 21 | } |
22 | | - |
23 | 22 | } |
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 @@ |
9 | 9 | * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason |
10 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | 11 | */ |
12 | | - |
13 | | -/** |
14 | | - * @ingroup SpecialPage |
15 | | - */ |
16 | 12 | class MostrevisionsPage extends FewestrevisionsPage { |
| 13 | + function __construct() { |
| 14 | + SpecialPage::__construct( 'Mostrevisions' ); |
| 15 | + } |
| 16 | + |
17 | 17 | function sortDescending() { |
18 | 18 | return true; |
19 | 19 | } |
20 | 20 | } |
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 @@ |
13 | 13 | class BrokenRedirectsPage extends PageQueryPage { |
14 | 14 | var $targets = array(); |
15 | 15 | |
16 | | - function getName() { |
17 | | - return 'BrokenRedirects'; |
| 16 | + function __construct() { |
| 17 | + SpecialPage::__construct( 'BrokenRedirects' ); |
18 | 18 | } |
19 | | - |
| 19 | + |
20 | 20 | // inexpensive? |
21 | 21 | function isExpensive() { return true; } |
22 | 22 | function isSyndicated() { return false; } |
— | — | @@ -87,14 +87,3 @@ |
88 | 88 | return $out; |
89 | 89 | } |
90 | 90 | } |
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 @@ |
16 | 16 | */ |
17 | 17 | class WantedCategoriesPage extends WantedQueryPage { |
18 | 18 | |
19 | | - function getName() { |
20 | | - return 'Wantedcategories'; |
| 19 | + function __construct() { |
| 20 | + SpecialPage::__construct( 'Wantedcategories' ); |
21 | 21 | } |
22 | 22 | |
23 | 23 | function getQueryInfo() { |
— | — | @@ -48,14 +48,3 @@ |
49 | 49 | return wfSpecialList($plink, $nlinks); |
50 | 50 | } |
51 | 51 | } |
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 @@ |
14 | 14 | // inexpensive? |
15 | 15 | function isExpensive() { return true; } |
16 | 16 | |
17 | | - function getName() { |
18 | | - return 'Unusedimages'; |
| 17 | + function __construct() { |
| 18 | + SpecialPage::__construct( 'Unusedimages' ); |
19 | 19 | } |
20 | | - |
| 20 | + |
21 | 21 | function sortDescending() { |
22 | 22 | return false; |
23 | 23 | } |
— | — | @@ -62,13 +62,3 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | } |
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 @@ |
14 | 14 | class WithoutInterwikiPage extends PageQueryPage { |
15 | 15 | private $prefix = ''; |
16 | 16 | |
17 | | - function getName() { |
18 | | - return 'Withoutinterwiki'; |
| 17 | + function __construct() { |
| 18 | + SpecialPage::__construct( 'Withoutinterwiki' ); |
19 | 19 | } |
| 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 | + } |
20 | 30 | |
21 | 31 | function getPageHeader() { |
22 | 32 | global $wgScript, $wgMiserMode; |
— | — | @@ -77,18 +87,8 @@ |
78 | 88 | function setPrefix( $prefix = '' ) { |
79 | 89 | $this->prefix = $prefix; |
80 | 90 | } |
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 ); |
91 | 94 | } |
92 | | - $wip = new WithoutInterwikiPage(); |
93 | | - $wip->setPrefix( $prefix ); |
94 | | - $wip->doQuery( $offset, $limit ); |
95 | 95 | } |
Index: branches/querypage-work/phase3/includes/specials/SpecialAncientpages.php |
— | — | @@ -10,8 +10,8 @@ |
11 | 11 | */ |
12 | 12 | class AncientPagesPage extends QueryPage { |
13 | 13 | |
14 | | - function getName() { |
15 | | - return "Ancientpages"; |
| 14 | + function __construct() { |
| 15 | + SpecialPage::__construct( 'Ancientpages' ); |
16 | 16 | } |
17 | 17 | |
18 | 18 | function isExpensive() { |
— | — | @@ -49,11 +49,3 @@ |
50 | 50 | return wfSpecialList( $link, $d ); |
51 | 51 | } |
52 | 52 | } |
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 @@ |
10 | 10 | */ |
11 | 11 | class DeadendPagesPage extends PageQueryPage { |
12 | 12 | |
13 | | - function getName() { |
14 | | - return "Deadendpages"; |
| 13 | + function __construct() { |
| 14 | + SpecialPage::__construct( 'Deadendpages' ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | function getPageHeader() { |
— | — | @@ -62,15 +62,3 @@ |
63 | 63 | return array( 'page_title' ); |
64 | 64 | } |
65 | 65 | } |
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 @@ |
16 | 16 | */ |
17 | 17 | class WantedFilesPage extends WantedQueryPage { |
18 | 18 | |
19 | | - function getName() { |
20 | | - return 'Wantedfiles'; |
| 19 | + function __construct() { |
| 20 | + SpecialPage::__construct( 'Wantedfiles' ); |
21 | 21 | } |
22 | 22 | |
23 | 23 | function getQueryInfo() { |
— | — | @@ -33,14 +33,3 @@ |
34 | 34 | ); |
35 | 35 | } |
36 | 36 | } |
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 @@ |
19 | 19 | */ |
20 | 20 | class MostlinkedPage extends QueryPage { |
21 | 21 | |
22 | | - function getName() { return 'Mostlinked'; } |
| 22 | + function __construct() { |
| 23 | + SpecialPage::__construct( 'Mostlinked' ); |
| 24 | + } |
| 25 | + |
23 | 26 | function isExpensive() { return true; } |
24 | 27 | function isSyndicated() { return false; } |
25 | 28 | |
— | — | @@ -83,14 +86,3 @@ |
84 | 87 | return wfSpecialList( $link, $wlh ); |
85 | 88 | } |
86 | 89 | } |
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 @@ |
16 | 16 | */ |
17 | 17 | class MostlinkedCategoriesPage extends QueryPage { |
18 | 18 | |
19 | | - function getName() { return 'Mostlinkedcategories'; } |
| 19 | + function __construct() { |
| 20 | + SpecialPage::__construct( 'Mostlinkedcategories' ); |
| 21 | + } |
| 22 | + |
20 | 23 | function isExpensive() { return true; } |
21 | 24 | function isSyndicated() { return false; } |
22 | 25 | |
— | — | @@ -59,14 +62,3 @@ |
60 | 63 | return wfSpecialList($plink, $nlinks); |
61 | 64 | } |
62 | 65 | } |
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 @@ |
11 | 11 | */ |
12 | 12 | class LongPagesPage extends ShortPagesPage { |
13 | 13 | |
14 | | - function getName() { |
15 | | - return "Longpages"; |
| 14 | + function __construct() { |
| 15 | + SpecialPage::__construct( 'Longpages' ); |
16 | 16 | } |
17 | 17 | |
18 | 18 | function sortDescending() { |
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | } |
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 @@ |
12 | 12 | */ |
13 | 13 | class LonelyPagesPage extends PageQueryPage { |
14 | 14 | |
15 | | - function getName() { |
16 | | - return "Lonelypages"; |
| 15 | + function __construct() { |
| 16 | + SpecialPage::__construct( 'Lonelypages' ); |
17 | 17 | } |
| 18 | + |
18 | 19 | function getPageHeader() { |
19 | 20 | return wfMsgExt( 'lonelypagestext', array( 'parse' ) ); |
20 | 21 | } |
— | — | @@ -60,14 +61,3 @@ |
61 | 62 | return array( 'page_title' ); |
62 | 63 | } |
63 | 64 | } |
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 @@ |
12 | 12 | * Special:LinkSearch to search the external-links table. |
13 | 13 | * @ingroup SpecialPage |
14 | 14 | */ |
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']; |
26 | 20 | } |
27 | 21 | |
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' ); |
43 | 24 | } |
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 | + |
46 | 36 | $target2 = $target; |
47 | 37 | $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 | + } |
49 | 57 | |
50 | | - $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' ); |
| 58 | + $self = $this->getTitle(); |
51 | 59 | |
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 ); |
66 | 74 | |
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 | + } |
74 | 84 | } |
75 | | -} |
76 | 85 | |
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 | | - |
88 | 86 | /** |
89 | 87 | * Disable RSS/Atom feeds |
90 | 88 | */ |
— | — | @@ -122,9 +120,13 @@ |
123 | 121 | $dbr = wfGetDB( DB_SLAVE ); |
124 | 122 | // strip everything past first wildcard, so that |
125 | 123 | // 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 ); |
129 | 131 | $encSearch = $dbr->addQuotes( $stripped ); |
130 | 132 | $retval = array ( |
131 | 133 | 'tables' => array ( 'page', 'externallinks' ), |
— | — | @@ -151,28 +153,12 @@ |
152 | 154 | } |
153 | 155 | |
154 | 156 | /** |
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 | | - /** |
171 | 157 | * Override to squash the ORDER BY. |
172 | 158 | * We do a truncated index search, so the optimizer won't trust |
173 | 159 | * it as good enough for optimizing sort. The implicit ordering |
174 | 160 | * from the scan will usually do well enough for our needs. |
175 | 161 | */ |
176 | | - function getOrder() { |
177 | | - return ''; |
| 162 | + function getOrderFields() { |
| 163 | + return array(); |
178 | 164 | } |
179 | 165 | } |
Index: branches/querypage-work/phase3/includes/specials/SpecialMostlinkedtemplates.php |
— | — | @@ -11,40 +11,19 @@ |
12 | 12 | * @ingroup SpecialPage |
13 | 13 | * @author Rob Church <robchur@gmail.com> |
14 | 14 | */ |
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' ); |
24 | 18 | } |
25 | 19 | |
26 | | - /** |
27 | | - * Is this report expensive, i.e should it be cached? |
28 | | - * |
29 | | - * @return bool |
30 | | - */ |
31 | 20 | public function isExpensive() { |
32 | 21 | return true; |
33 | 22 | } |
34 | 23 | |
35 | | - /** |
36 | | - * Is there a feed available? |
37 | | - * |
38 | | - * @return bool |
39 | | - */ |
40 | 24 | public function isSyndicated() { |
41 | 25 | return false; |
42 | 26 | } |
43 | 27 | |
44 | | - /** |
45 | | - * Sort the results in descending order? |
46 | | - * |
47 | | - * @return bool |
48 | | - */ |
49 | 28 | public function sortDescending() { |
50 | 29 | return true; |
51 | 30 | } |
— | — | @@ -76,13 +55,6 @@ |
77 | 56 | $db->dataSeek( $res, 0 ); |
78 | 57 | } |
79 | 58 | |
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 | | - */ |
87 | 59 | public function formatResult( $skin, $result ) { |
88 | 60 | $title = Title::makeTitle( $result->namespace, $result->title ); |
89 | 61 | |
— | — | @@ -109,14 +81,3 @@ |
110 | 82 | return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) ); |
111 | 83 | } |
112 | 84 | } |
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 @@ |
10 | 10 | * @ingroup SpecialPage |
11 | 11 | */ |
12 | 12 | 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' ); |
15 | 17 | } |
16 | | - |
17 | | - function getName() { |
18 | | - return "Uncategorizedcategories"; |
19 | | - } |
20 | 18 | } |
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 @@ |
481 | 481 | 'MostimagesPage' => 'includes/specials/SpecialMostimages.php', |
482 | 482 | 'MostlinkedCategoriesPage' => 'includes/specials/SpecialMostlinkedcategories.php', |
483 | 483 | 'MostlinkedPage' => 'includes/specials/SpecialMostlinked.php', |
| 484 | + 'MostlinkedTemplatesPage' => 'includes/specials/SpecialMostlinkedtemplates.php', |
484 | 485 | 'MostrevisionsPage' => 'includes/specials/SpecialMostrevisions.php', |
485 | 486 | 'MovePageForm' => 'includes/specials/SpecialMovepage.php', |
486 | 487 | 'SpecialNewpages' => 'includes/specials/SpecialNewpages.php', |
— | — | @@ -498,7 +499,6 @@ |
499 | 500 | 'SpecialExport' => 'includes/specials/SpecialExport.php', |
500 | 501 | 'SpecialImport' => 'includes/specials/SpecialImport.php', |
501 | 502 | 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php', |
502 | | - 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php', |
503 | 503 | 'SpecialPreferences' => 'includes/specials/SpecialPreferences.php', |
504 | 504 | 'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php', |
505 | 505 | 'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php', |
— | — | @@ -511,6 +511,7 @@ |
512 | 512 | 'SpecialVersion' => 'includes/specials/SpecialVersion.php', |
513 | 513 | 'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php', |
514 | 514 | 'UncategorizedCategoriesPage' => 'includes/specials/SpecialUncategorizedcategories.php', |
| 515 | + 'UncategorizedImagesPage' => 'includes/specials/SpecialUncategorizedimages.php', |
515 | 516 | 'UncategorizedPagesPage' => 'includes/specials/SpecialUncategorizedpages.php', |
516 | 517 | 'UncategorizedTemplatesPage' => 'includes/specials/SpecialUncategorizedtemplates.php', |
517 | 518 | 'UndeleteForm' => 'includes/specials/SpecialUndelete.php', |
Index: branches/querypage-work/phase3/includes/SpecialPage.php |
— | — | @@ -81,39 +81,39 @@ |
82 | 82 | */ |
83 | 83 | static public $mList = array( |
84 | 84 | # 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' ), |
93 | 93 | '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' ), |
108 | 108 | |
109 | 109 | # List of pages |
110 | | - 'Allpages' => 'SpecialAllpages', |
111 | | - 'Prefixindex' => 'SpecialPrefixindex', |
| 110 | + 'Allpages' => 'SpecialAllpages', |
| 111 | + 'Prefixindex' => 'SpecialPrefixindex', |
112 | 112 | 'Categories' => array( 'SpecialPage', 'Categories' ), |
113 | | - 'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ), |
114 | | - 'Listredirects' => array( 'SpecialPage', 'Listredirects' ), |
| 113 | + 'Disambiguations' => array( 'DisambiguationsPage' ), |
| 114 | + 'Listredirects' => array( 'ListredirectsPage' ), |
115 | 115 | |
116 | 116 | # Login/create account |
117 | | - 'Userlogin' => array( 'SpecialPage', 'Userlogin' ), |
| 117 | + 'Userlogin' => array( 'SpecialPage', 'Userlogin' ), |
118 | 118 | 'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ), |
119 | 119 | |
120 | 120 | # Users and rights |
— | — | @@ -156,12 +156,12 @@ |
157 | 157 | 'Randomredirect' => 'SpecialRandomredirect', |
158 | 158 | |
159 | 159 | # 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' ), |
166 | 166 | |
167 | 167 | # Page tools |
168 | 168 | 'Export' => 'SpecialExport', |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | self::$mListInitialised = true; |
212 | 212 | |
213 | 213 | if( !$wgDisableCounters ) { |
214 | | - self::$mList['Popularpages'] = array( 'SpecialPage', 'Popularpages' ); |
| 214 | + self::$mList['Popularpages'] = array( 'PopularpagesPage' ); |
215 | 215 | } |
216 | 216 | |
217 | 217 | if( !$wgDisableInternalSearch ) { |
Index: branches/querypage-work/phase3/includes/QueryPage.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | array( 'MostcategoriesPage', 'Mostcategories' ), |
30 | 30 | array( 'MostimagesPage', 'Mostimages' ), |
31 | 31 | array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ), |
32 | | - array( 'SpecialMostlinkedtemplates', 'Mostlinkedtemplates' ), |
| 32 | + array( 'MostlinkedTemplatesPage', 'Mostlinkedtemplates' ), |
33 | 33 | array( 'MostlinkedPage', 'Mostlinked' ), |
34 | 34 | array( 'MostrevisionsPage', 'Mostrevisions' ), |
35 | 35 | array( 'FewestrevisionsPage', 'Fewestrevisions' ), |
— | — | @@ -91,15 +91,6 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | | - * Return title object representing this page |
96 | | - * |
97 | | - * @return Title |
98 | | - */ |
99 | | - function getTitle() { |
100 | | - return SpecialPage::getTitleFor( $this->getName() ); |
101 | | - } |
102 | | - |
103 | | - /** |
104 | 95 | * Subclasses return an SQL query here, formatted as an array with the |
105 | 96 | * following keys: |
106 | 97 | * tables => Table(s) for passing to Database::select() |
— | — | @@ -367,7 +358,8 @@ |
368 | 359 | function execute( $par ) { |
369 | 360 | global $wgUser, $wgOut, $wgLang; |
370 | 361 | |
371 | | - list( $this->limit, $this->offset ) = wfCheckLimits(); |
| 362 | + if( $this->limit == 0 && $this->offset == 0 ) |
| 363 | + list( $this->limit, $this->offset ) = wfCheckLimits(); |
372 | 364 | $sname = $this->getName(); |
373 | 365 | $fname = get_class( $this ) . '::doQuery'; |
374 | 366 | $dbr = wfGetDB( DB_SLAVE ); |