MediaWiki REL1_33
SpecialFewestrevisions.php
Go to the documentation of this file.
1<?php
25
33 function __construct( $name = 'Fewestrevisions' ) {
34 parent::__construct( $name );
35 }
36
37 public function isExpensive() {
38 return true;
39 }
40
41 function isSyndicated() {
42 return false;
43 }
44
45 public function getQueryInfo() {
46 return [
47 'tables' => [ 'revision', 'page' ],
48 'fields' => [
49 'namespace' => 'page_namespace',
50 'title' => 'page_title',
51 'value' => 'COUNT(*)',
52 'redirect' => 'page_is_redirect'
53 ],
54 'conds' => [
55 'page_namespace' => MWNamespace::getContentNamespaces(),
56 'page_id = rev_page' ],
57 'options' => [
58 'GROUP BY' => [ 'page_namespace', 'page_title', 'page_is_redirect' ]
59 ]
60 ];
61 }
62
63 function sortDescending() {
64 return false;
65 }
66
72 function formatResult( $skin, $result ) {
73 $nt = Title::makeTitleSafe( $result->namespace, $result->title );
74 if ( !$nt ) {
75 return Html::element(
76 'span',
77 [ 'class' => 'mw-invalidtitle' ],
79 $this->getContext(),
80 $result->namespace,
81 $result->title
82 )
83 );
84 }
86 $text = MediaWikiServices::getInstance()->getContentLanguage()->
87 convert( htmlspecialchars( $nt->getPrefixedText() ) );
88 $plink = $linkRenderer->makeLink( $nt, new HtmlArmor( $text ) );
89
90 $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->text();
91 $redirect = isset( $result->redirect ) && $result->redirect ?
92 ' - ' . $this->msg( 'isredirect' )->escaped() : '';
93 $nlink = $linkRenderer->makeKnownLink(
94 $nt,
95 $nl,
96 [],
97 [ 'action' => 'history' ]
98 ) . $redirect;
99
100 return $this->getLanguage()->specialList( $plink, $nlink );
101 }
102
103 protected function getGroupName() {
104 return 'maintenance';
105 }
106}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Special page for listing the articles with the fewest revisions.
isSyndicated()
Sometime we don't want to build rss / atom feeds.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
sortDescending()
Override to sort by increasing values.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
__construct( $name='Fewestrevisions')
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:28
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
Definition Linker.php:191
MediaWikiServices is the service locator for the application scope of MediaWiki.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
Definition QueryPage.php:35
getContext()
Gets the context this SpecialPage is executed in.
msg( $key)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
MediaWiki Linker LinkRenderer null $linkRenderer