MediaWiki  master
SpecialUncategorizedPages.php
Go to the documentation of this file.
1 <?php
25 
34  protected $requestedNamespace = false;
35 
36  public function __construct( $name = 'Uncategorizedpages' ) {
37  parent::__construct( $name );
38  $this->addHelpLink( 'Help:Categories' );
39  }
40 
41  protected function sortDescending() {
42  return false;
43  }
44 
45  public function isExpensive() {
46  return true;
47  }
48 
49  public function isSyndicated() {
50  return false;
51  }
52 
53  public 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  protected 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 }
SpecialUncategorizedPages\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialUncategorizedPages.php:89
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:146
SpecialUncategorizedPages
A special page looking for page without any category.
Definition: SpecialUncategorizedPages.php:32
SpecialUncategorizedPages\isExpensive
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
Definition: SpecialUncategorizedPages.php:45
SpecialUncategorizedPages\getOrderFields
getOrderFields()
Subclasses return an array of fields to order by here.
Definition: SpecialUncategorizedPages.php:76
PageQueryPage
Variant of QueryPage which formats the result as a simple link to the page.
Definition: PageQueryPage.php:32
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:836
SpecialUncategorizedPages\__construct
__construct( $name='Uncategorizedpages')
Definition: SpecialUncategorizedPages.php:36
SpecialUncategorizedPages\sortDescending
sortDescending()
Override to sort by increasing values.
Definition: SpecialUncategorizedPages.php:41
SpecialUncategorizedPages\$requestedNamespace
int false $requestedNamespace
Definition: SpecialUncategorizedPages.php:34
SpecialUncategorizedPages\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Definition: SpecialUncategorizedPages.php:53
SpecialUncategorizedPages\isSyndicated
isSyndicated()
Sometime we don't want to build rss / atom feeds.
Definition: SpecialUncategorizedPages.php:49