MediaWiki REL1_28
SpecialUncategorizedpages.php
Go to the documentation of this file.
1<?php
31 protected $requestedNamespace = false;
32
33 function __construct( $name = 'Uncategorizedpages' ) {
34 parent::__construct( $name );
35 }
36
37 function sortDescending() {
38 return false;
39 }
40
41 function isExpensive() {
42 return true;
43 }
44
45 function isSyndicated() {
46 return false;
47 }
48
49 function getQueryInfo() {
50 return [
51 'tables' => [ 'page', 'categorylinks' ],
52 'fields' => [
53 'namespace' => 'page_namespace',
54 'title' => 'page_title',
55 'value' => 'page_title'
56 ],
57 // default for page_namespace is all content namespaces (if requestedNamespace is false)
58 // otherwise, page_namespace is requestedNamespace
59 'conds' => [
60 'cl_from IS NULL',
61 'page_namespace' => $this->requestedNamespace !== false
62 ? $this->requestedNamespace
63 : MWNamespace::getContentNamespaces(),
64 'page_is_redirect' => 0
65 ],
66 'join_conds' => [
67 'categorylinks' => [ 'LEFT JOIN', 'cl_from = page_id' ]
68 ]
69 ];
70 }
71
72 function getOrderFields() {
73 // For some crazy reason ordering by a constant
74 // causes a filesort
75 if ( $this->requestedNamespace === false && count( MWNamespace::getContentNamespaces() ) > 1 ) {
76 return [ 'page_namespace', 'page_title' ];
77 }
78
79 return [ 'page_title' ];
80 }
81
82 protected function getGroupName() {
83 return 'maintenance';
84 }
85}
Variant of QueryPage which formats the result as a simple link to the page.
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.
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.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:304
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition injection.txt:37