MediaWiki  1.34.0
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 }
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:117
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:33
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:828
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