28 namespace MediaWiki\Specials;
62 parent::__construct(
'Mostlinked' );
65 $this->linksMigration = $linksMigration;
77 $tableFields = $this->linksMigration->getTitleFields(
'pagelinks' );
79 'namespace' => $tableFields[0],
80 'title' => $tableFields[1],
82 $queryInfo = $this->linksMigration->getQueryInfo(
'pagelinks' );
84 'tables' => array_merge( $queryInfo[
'tables'], [
'page' ] ),
85 'fields' => array_merge( [
'value' =>
'COUNT(*)',
'page_namespace' ], $fields ),
87 'HAVING' =>
'COUNT(*) > 1',
88 'GROUP BY' => array_merge( $tableFields, [
'page_namespace' ] )
90 'join_conds' => array_merge( $queryInfo[
'joins'], [
94 'page_namespace = ' . $fields[
'namespace'],
95 'page_title = ' . $fields[
'title']
118 private function makeWlhLink( $title, $caption ) {
122 return $linkRenderer->makeKnownLink( $wlh, $caption );
138 [
'class' =>
'mw-invalidtitle' ],
147 $link = $linkRenderer->makeLink( $title );
148 $wlh = $this->makeWlhLink(
150 $this->
msg(
'nlinks' )->numParams( $result->value )->text()
153 return $this->
getLanguage()->specialList( $link, $wlh );
165 class_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.