9use MediaWiki\Cache\LinkBatchFactory;
10use MediaWiki\Languages\LanguageConverterFactory;
30 LinkBatchFactory $linkBatchFactory,
31 LanguageConverterFactory $languageConverterFactory,
34 parent::__construct(
'Lonelypages' );
35 $this->namespaceInfo = $namespaceInfo;
38 $this->
setLanguageConverter( $languageConverterFactory->getLanguageConverter( $this->getContentLanguage() ) );
39 $this->linksMigration = $linksMigration;
44 return $this->
msg(
'lonelypagestext' )->parseAsBlock();
64 $queryInfo = $this->linksMigration->getQueryInfo(
'pagelinks',
'pagelinks',
'LEFT JOIN' );
65 $tables = [
'page',
'linktarget',
'templatelinks',
'pagelinks' ];
68 'page_namespace' => $this->namespaceInfo->getContentNamespaces(),
69 'page_is_redirect' => 0,
73 'templatelinks' => [
'LEFT JOIN', [
'tl_target_id=lt_id' ] ],
76 "lt_namespace = page_namespace",
77 "lt_title = page_title"
82 if ( !in_array(
'linktarget', $queryInfo[
'tables'] ) ) {
83 $joinConds[
'pagelinks'] = [
85 "pl_namespace = page_namespace",
86 "pl_title = page_title"
92 $this->
getHookRunner()->onLonelyPagesQuery( $tables, $conds, $joinConds );
97 'namespace' =>
'page_namespace',
98 'title' =>
'page_title',
101 'join_conds' => array_merge( $joinConds, $queryInfo[
'joins'] )
109 if ( count( $this->namespaceInfo->getContentNamespaces() ) > 1 ) {
110 return [
'page_namespace',
'page_title' ];
112 return [
'page_title' ];
118 return 'maintenance';
123class_alias( SpecialLonelyPages::class,
'SpecialLonelyPages' );
Variant of QueryPage which formats the result as a simple link to the page.
setLanguageConverter(ILanguageConverter $languageConverter)
setDatabaseProvider(IConnectionProvider $databaseProvider)
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
List of articles with no article linking to them, thus being lonely.
isExpensive()
Should this query page only be updated offline on large wikis?If the query for this page is considere...
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getPageHeader()
The content returned by this function will be output before any result.to override string
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
sortDescending()
Override to sort by increasing values.to override bool
isSyndicated()
Sometimes we don't want to build rss / atom feeds.to override bool
getOrderFields()
Subclasses return an array of fields to order by here.Don't append DESC to the field names,...
__construct(NamespaceInfo $namespaceInfo, IConnectionProvider $dbProvider, LinkBatchFactory $linkBatchFactory, LanguageConverterFactory $languageConverterFactory, LinksMigration $linksMigration)