MediaWiki
REL1_39
SpecialWantedTemplates.php
Go to the documentation of this file.
1
<?php
29
use
MediaWiki\Cache\LinkBatchFactory
;
30
use
MediaWiki\Linker\LinksMigration
;
31
use
Wikimedia\Rdbms\ILoadBalancer
;
32
38
class
SpecialWantedTemplates
extends
WantedQueryPage
{
39
41
private
$linksMigration;
42
48
public
function
__construct
(
49
ILoadBalancer
$loadBalancer,
50
LinkBatchFactory
$linkBatchFactory,
51
LinksMigration
$linksMigration
52
) {
53
parent::__construct(
'Wantedtemplates'
);
54
$this->
setDBLoadBalancer
( $loadBalancer );
55
$this->
setLinkBatchFactory
( $linkBatchFactory );
56
$this->linksMigration = $linksMigration;
57
}
58
59
public
function
getQueryInfo
() {
60
$queryInfo = $this->linksMigration->getQueryInfo(
'templatelinks'
);
61
list( $ns,
$title
) = $this->linksMigration->getTitleFields(
'templatelinks'
);
62
return
[
63
'tables'
=> array_merge( $queryInfo[
'tables'
], [
'page'
] ),
64
'fields'
=> [
65
'namespace'
=> $ns,
66
'title'
=>
$title
,
67
'value'
=>
'COUNT(*)'
68
],
69
'conds'
=> [
70
'page_title IS NULL'
,
71
$ns =>
NS_TEMPLATE
72
],
73
'options'
=> [
'GROUP BY'
=> [ $ns,
$title
] ],
74
'join_conds'
=> array_merge(
75
[
'page'
=> [
'LEFT JOIN'
,
76
[
"page_namespace = $ns"
,
"page_title = $title"
] ] ],
77
$queryInfo[
'joins'
]
78
)
79
];
80
}
81
82
protected
function
getGroupName
() {
83
return
'maintenance'
;
84
}
85
}
NS_TEMPLATE
const NS_TEMPLATE
Definition
Defines.php:74
MediaWiki\Cache\LinkBatchFactory
Definition
LinkBatchFactory.php:41
MediaWiki\Linker\LinksMigration
Service for compat reading of links tables.
Definition
LinksMigration.php:32
QueryPage\setDBLoadBalancer
setDBLoadBalancer(ILoadBalancer $loadBalancer)
Definition
QueryPage.php:916
QueryPage\setLinkBatchFactory
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
Definition
QueryPage.php:136
SpecialWantedTemplates
A querypage to list the most wanted templates.
Definition
SpecialWantedTemplates.php:38
SpecialWantedTemplates\__construct
__construct(ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory, LinksMigration $linksMigration)
Definition
SpecialWantedTemplates.php:48
SpecialWantedTemplates\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Definition
SpecialWantedTemplates.php:59
SpecialWantedTemplates\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition
SpecialWantedTemplates.php:82
WantedQueryPage
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
Definition
WantedQueryPage.php:33
Wikimedia\Rdbms\ILoadBalancer
Create and track the database connections and transactions for a given database cluster.
Definition
ILoadBalancer.php:77
$title
$title
Definition
testCompression.php:38
includes
specials
SpecialWantedTemplates.php
Generated on Mon Dec 23 2024 06:24:55 for MediaWiki by
1.10.0