57 parent::__construct(
'Lonelypages' );
66 return $this->
msg(
'lonelypagestext' )->parseAsBlock();
82 $queryInfo = $this->linksMigration->getQueryInfo(
87 list( $ns,
$title ) = $this->linksMigration->getTitleFields(
'templatelinks' );
88 $tables = array_merge( [
'page',
'pagelinks' ], $queryInfo[
'tables'] );
90 'pl_namespace IS NULL',
91 'page_namespace' => $this->namespaceInfo->getContentNamespaces(),
92 'page_is_redirect' => 0,
98 'pl_namespace = page_namespace',
99 'pl_title = page_title'
103 $templatelinksJoin = [
105 "$ns = page_namespace",
106 "$title = page_title"
109 if ( in_array(
'linktarget', $tables ) ) {
110 $joinConds[
'linktarget'] = $templatelinksJoin;
112 $joinConds[
'templatelinks'] = $templatelinksJoin;
116 $this->
getHookRunner()->onLonelyPagesQuery( $tables, $conds, $joinConds );
121 'namespace' =>
'page_namespace',
122 'title' =>
'page_title',
125 'join_conds' => array_merge( $joinConds, $queryInfo[
'joins'] )
132 if ( count( $this->namespaceInfo->getContentNamespaces() ) > 1 ) {
133 return [
'page_namespace',
'page_title' ];
135 return [
'page_title' ];
140 return 'maintenance';
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Variant of QueryPage which formats the result as a simple link to the page.
setLanguageConverter(ILanguageConverter $languageConverter)
setDBLoadBalancer(ILoadBalancer $loadBalancer)
LinkBatchFactory null $linkBatchFactory
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
ILoadBalancer null $loadBalancer
A special page looking for articles with no article linking to them, thus being lonely.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
__construct(NamespaceInfo $namespaceInfo, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory, LanguageConverterFactory $languageConverterFactory, LinksMigration $linksMigration)
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
NamespaceInfo $namespaceInfo
getOrderFields()
Subclasses return an array of fields to order by here.
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
LinksMigration $linksMigration
getPageHeader()
The content returned by this function will be output before any result.
sortDescending()
Override to sort by increasing values.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.