37 private $currentCategoryCounts;
40 private $languageConverter;
52 parent::__construct(
'Wantedcategories' );
60 'tables' => [
'categorylinks',
'page' ],
66 'conds' => [
'page_title IS NULL' ],
67 'options' => [
'GROUP BY' =>
'cl_to' ],
68 'join_conds' => [
'page' => [
'LEFT JOIN',
69 [
'page_title = cl_to',
75 parent::preprocessResults( $db,
$res );
77 $this->currentCategoryCounts = [];
79 if ( !
$res->numRows() || !$this->isCached() ) {
87 foreach (
$res as $row ) {
88 $allCategories[] = $row->title;
91 $categoryRes = $db->select(
93 [
'cat_title',
'cat_pages' ],
94 [
'cat_title' => $allCategories ],
97 foreach ( $categoryRes as $row ) {
98 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
111 $nt = Title::makeTitle( $result->namespace, $result->title );
113 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
121 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
125 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
126 $cachedValue = intval( $result->value );
129 if ( $nt->isKnown() || $currentValue === 0 ) {
130 $plink =
"<del>$plink</del>";
134 if ( $currentValue !== $cachedValue ) {
135 $nlinks = $this->
msg(
'nmemberschanged' )
136 ->numParams( $cachedValue, $currentValue )->escaped();
138 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
142 return $this->
getLanguage()->specialList( $plink, $nlinks );
146 return 'maintenance';
Marks HTML that shouldn't be escaped.
setDBLoadBalancer(ILoadBalancer $loadBalancer)
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
getContentLanguage()
Shortcut to get content language.
A querypage to list the most wanted categories - implements Special:Wantedcategories.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
preprocessResults( $db, $res)
Cache page existence for performance.
__construct(ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory, LanguageConverterFactory $languageConverterFactory)
formatResult( $skin, $result)
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
The shared interface for all language converters.