MediaWiki master
SpecialMostImages.php
Go to the documentation of this file.
1<?php
23namespace MediaWiki\Specials;
24
27
35
39 public function __construct( IConnectionProvider $dbProvider ) {
40 parent::__construct( 'Mostimages' );
41 $this->setDatabaseProvider( $dbProvider );
42 }
43
44 public function isExpensive() {
45 return true;
46 }
47
48 public function isSyndicated() {
49 return false;
50 }
51
52 public function getQueryInfo() {
53 return [
54 'tables' => [ 'imagelinks' ],
55 'fields' => [
56 'namespace' => NS_FILE,
57 'title' => 'il_to',
58 'value' => 'COUNT(*)'
59 ],
60 'options' => [
61 'GROUP BY' => 'il_to',
62 'HAVING' => 'COUNT(*) > 1'
63 ]
64 ];
65 }
66
67 protected function getCellHtml( $row ) {
68 return $this->msg( 'nimagelinks' )->numParams( $row->value )->escaped() . '<br />';
69 }
70
71 protected function getGroupName() {
72 return 'highuse';
73 }
74}
75
80class_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.