MediaWiki master
SpecialMostImages.php
Go to the documentation of this file.
1<?php
23namespace MediaWiki\Specials;
24
27
35
36 public function __construct( IConnectionProvider $dbProvider ) {
37 parent::__construct( 'Mostimages' );
38 $this->setDatabaseProvider( $dbProvider );
39 }
40
41 public function isExpensive() {
42 return true;
43 }
44
45 public function isSyndicated() {
46 return false;
47 }
48
49 public function getQueryInfo() {
50 return [
51 'tables' => [ 'imagelinks' ],
52 'fields' => [
53 'namespace' => NS_FILE,
54 'title' => 'il_to',
55 'value' => 'COUNT(*)'
56 ],
57 'options' => [
58 'GROUP BY' => 'il_to',
59 'HAVING' => 'COUNT(*) > 1'
60 ]
61 ];
62 }
63
64 protected function getCellHtml( $row ) {
65 return $this->msg( 'nimagelinks' )->numParams( $row->value )->escaped() . '<br />';
66 }
67
68 protected function getGroupName() {
69 return 'highuse';
70 }
71}
72
77class_alias( SpecialMostImages::class, 'MostimagesPage' );
const NS_FILE
Definition Defines.php:71
Variant of QueryPage which uses a gallery to output results, thus suited for reports generating image...
setDatabaseProvider(IConnectionProvider $databaseProvider)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
List of the most used images.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getCellHtml( $row)
Get additional HTML to be shown in a results' cell.
isExpensive()
Should this query page only be updated offline on large wikis?
__construct(IConnectionProvider $dbProvider)
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Provide primary and replica IDatabase connections.