MediaWiki REL1_34
SpecialUncategorizedPages.php
Go to the documentation of this file.
1<?php
25
34 protected $requestedNamespace = false;
35
36 function __construct( $name = 'Uncategorizedpages' ) {
37 parent::__construct( $name );
38 $this->addHelpLink( 'Help:Categories' );
39 }
40
41 function sortDescending() {
42 return false;
43 }
44
45 function isExpensive() {
46 return true;
47 }
48
49 function isSyndicated() {
50 return false;
51 }
52
53 function getQueryInfo() {
54 return [
55 'tables' => [ 'page', 'categorylinks' ],
56 'fields' => [
57 'namespace' => 'page_namespace',
58 'title' => 'page_title',
59 ],
60 // default for page_namespace is all content namespaces (if requestedNamespace is false)
61 // otherwise, page_namespace is requestedNamespace
62 'conds' => [
63 'cl_from IS NULL',
64 'page_namespace' => $this->requestedNamespace !== false
65 ? $this->requestedNamespace
66 : MediaWikiServices::getInstance()->getNamespaceInfo()->
67 getContentNamespaces(),
68 'page_is_redirect' => 0
69 ],
70 'join_conds' => [
71 'categorylinks' => [ 'LEFT JOIN', 'cl_from = page_id' ]
72 ]
73 ];
74 }
75
76 function getOrderFields() {
77 // For some crazy reason ordering by a constant
78 // causes a filesort
79 if ( $this->requestedNamespace === false &&
80 count( MediaWikiServices::getInstance()->getNamespaceInfo()->
81 getContentNamespaces() ) > 1
82 ) {
83 return [ 'page_namespace', 'page_title' ];
84 }
85
86 return [ 'page_title' ];
87 }
88
89 protected function getGroupName() {
90 return 'maintenance';
91 }
92}
MediaWikiServices is the service locator for the application scope of MediaWiki.
Variant of QueryPage which formats the result as a simple link to the page.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
A special page looking for page without any category.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
__construct( $name='Uncategorizedpages')
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getOrderFields()
Subclasses return an array of fields to order by here.
isSyndicated()
Sometime we don't want to build rss / atom feeds.
sortDescending()
Override to sort by increasing values.