MediaWiki  master
SpecialWantedTemplates.php
Go to the documentation of this file.
1 <?php
31 
38 
43  public function __construct(
46  ) {
47  parent::__construct( 'Wantedtemplates' );
48  $this->setDBLoadBalancer( $loadBalancer );
49  $this->setLinkBatchFactory( $linkBatchFactory );
50  }
51 
52  public function getQueryInfo() {
53  return [
54  'tables' => [ 'templatelinks', 'page' ],
55  'fields' => [
56  'namespace' => 'tl_namespace',
57  'title' => 'tl_title',
58  'value' => 'COUNT(*)'
59  ],
60  'conds' => [
61  'page_title IS NULL',
62  'tl_namespace' => NS_TEMPLATE
63  ],
64  'options' => [ 'GROUP BY' => [ 'tl_namespace', 'tl_title' ] ],
65  'join_conds' => [ 'page' => [ 'LEFT JOIN',
66  [ 'page_namespace = tl_namespace',
67  'page_title = tl_title' ] ] ]
68  ];
69  }
70 
71  protected function getGroupName() {
72  return 'maintenance';
73  }
74 }
QueryPage\setLinkBatchFactory
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
Definition: QueryPage.php:136
SpecialWantedTemplates
A querypage to list the most wanted templates.
Definition: SpecialWantedTemplates.php:37
SpecialWantedTemplates\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Definition: SpecialWantedTemplates.php:52
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
NS_TEMPLATE
const NS_TEMPLATE
Definition: Defines.php:73
SpecialWantedTemplates\__construct
__construct(ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory)
Definition: SpecialWantedTemplates.php:43
SpecialWantedTemplates\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialWantedTemplates.php:71
QueryPage\setDBLoadBalancer
setDBLoadBalancer(ILoadBalancer $loadBalancer)
Definition: QueryPage.php:873
QueryPage\$linkBatchFactory
LinkBatchFactory null $linkBatchFactory
Definition: QueryPage.php:74
QueryPage\$loadBalancer
ILoadBalancer null $loadBalancer
Definition: QueryPage.php:71
WantedQueryPage
Class definition for a wanted query page like WantedPages, WantedTemplates, etc Stable to extend.
Definition: WantedQueryPage.php:33
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81