MediaWiki  master
SpecialMostImages.php
Go to the documentation of this file.
1 <?php
27 namespace MediaWiki\Specials;
28 
31 
38 
42  public function __construct( IConnectionProvider $dbProvider ) {
43  parent::__construct( 'Mostimages' );
44  $this->setDatabaseProvider( $dbProvider );
45  }
46 
47  public function isExpensive() {
48  return true;
49  }
50 
51  public function isSyndicated() {
52  return false;
53  }
54 
55  public function getQueryInfo() {
56  return [
57  'tables' => [ 'imagelinks' ],
58  'fields' => [
59  'namespace' => NS_FILE,
60  'title' => 'il_to',
61  'value' => 'COUNT(*)'
62  ],
63  'options' => [
64  'GROUP BY' => 'il_to',
65  'HAVING' => 'COUNT(*) > 1'
66  ]
67  ];
68  }
69 
70  protected function getCellHtml( $row ) {
71  return $this->msg( 'nimagelinks' )->numParams( $row->value )->escaped() . '<br />';
72  }
73 
74  protected function getGroupName() {
75  return 'highuse';
76  }
77 }
78 
83 class_alias( SpecialMostImages::class, 'MostimagesPage' );
const NS_FILE
Definition: Defines.php:70
Variant of QueryPage which uses a gallery to output results, thus suited for reports generating image...
setDatabaseProvider(IConnectionProvider $databaseProvider)
Definition: QueryPage.php:985
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
A special page that lists 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.