MediaWiki  master
SpecialMostimages.php
Go to the documentation of this file.
1 <?php
28 
35 
39  public function __construct( ILoadBalancer $loadBalancer ) {
40  parent::__construct( 'Mostimages' );
41  $this->setDBLoadBalancer( $loadBalancer );
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 }
const NS_FILE
Definition: Defines.php:70
Variant of QueryPage which uses a gallery to output results, thus suited for reports generating image...
A special page that lists most used images.
isExpensive()
Should this query page only be updated offline on large wikis?
__construct(ILoadBalancer $loadBalancer)
isSyndicated()
Sometimes 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...
getCellHtml( $row)
Get additional HTML to be shown in a results' cell.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
setDBLoadBalancer(ILoadBalancer $loadBalancer)
Definition: QueryPage.php:916
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Create and track the database connections and transactions for a given database cluster.