59 parent::__construct(
'Mostlinked' );
62 $this->linksMigration = $linksMigration;
74 $tableFields = $this->linksMigration->getTitleFields(
'pagelinks' );
76 'namespace' => $tableFields[0],
77 'title' => $tableFields[1],
79 $queryInfo = $this->linksMigration->getQueryInfo(
'pagelinks' );
81 'tables' => array_merge( $queryInfo[
'tables'], [
'page' ] ),
82 'fields' => array_merge( [
'value' =>
'COUNT(*)',
'page_namespace' ], $fields ),
84 'HAVING' =>
'COUNT(*) > 1',
85 'GROUP BY' => array_merge( $tableFields, [
'page_namespace' ] )
87 'join_conds' => array_merge( $queryInfo[
'joins'], [
91 'page_namespace = ' . $fields[
'namespace'],
92 'page_title = ' . $fields[
'title']
115 private function makeWlhLink( $title, $caption ) {
119 return $linkRenderer->makeKnownLink( $wlh, $caption );
131 $title = Title::makeTitleSafe( $result->namespace, $result->title );
135 [
'class' =>
'mw-invalidtitle' ],
136 Linker::getInvalidTitleDescription(
144 $link = $linkRenderer->makeLink( $title );
145 $wlh = $this->makeWlhLink(
147 $this->
msg(
'nlinks' )->numParams( $result->value )->text()
150 return $this->
getLanguage()->specialList( $link, $wlh );
162class_alias( SpecialMostLinked::class,
'SpecialMostLinked' );
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDatabaseProvider(IConnectionProvider $databaseProvider)
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
The base class for all skins.