MediaWiki REL1_31
SpecialLonelypages.php
Go to the documentation of this file.
1<?php
31 function __construct( $name = 'Lonelypages' ) {
32 parent::__construct( $name );
33 }
34
35 function getPageHeader() {
36 return $this->msg( 'lonelypagestext' )->parseAsBlock();
37 }
38
39 function sortDescending() {
40 return false;
41 }
42
43 function isExpensive() {
44 return true;
45 }
46
47 function isSyndicated() {
48 return false;
49 }
50
51 function getQueryInfo() {
52 $tables = [ 'page', 'pagelinks', 'templatelinks' ];
53 $conds = [
54 'pl_namespace IS NULL',
55 'page_namespace' => MWNamespace::getContentNamespaces(),
56 'page_is_redirect' => 0,
57 'tl_namespace IS NULL'
58 ];
59 $joinConds = [
60 'pagelinks' => [
61 'LEFT JOIN', [
62 'pl_namespace = page_namespace',
63 'pl_title = page_title'
64 ]
65 ],
66 'templatelinks' => [
67 'LEFT JOIN', [
68 'tl_namespace = page_namespace',
69 'tl_title = page_title'
70 ]
71 ]
72 ];
73
74 // Allow extensions to modify the query
75 Hooks::run( 'LonelyPagesQuery', [ &$tables, &$conds, &$joinConds ] );
76
77 return [
78 'tables' => $tables,
79 'fields' => [
80 'namespace' => 'page_namespace',
81 'title' => 'page_title',
82 ],
83 'conds' => $conds,
84 'join_conds' => $joinConds
85 ];
86 }
87
88 function getOrderFields() {
89 // For some crazy reason ordering by a constant
90 // causes a filesort in MySQL 5
91 if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
92 return [ 'page_namespace', 'page_title' ];
93 } else {
94 return [ 'page_title' ];
95 }
96 }
97
98 protected function getGroupName() {
99 return 'maintenance';
100 }
101}
A special page looking for articles with no article linking to them, thus being lonely.
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.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
__construct( $name='Lonelypages')
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getPageHeader()
The content returned by this function will be output before any result.
sortDescending()
Override to sort by increasing values.
Variant of QueryPage which formats the result as a simple link to the page.
msg( $key)
Wrapper around wfMessage that sets the current context.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
Definition hooks.txt:1015