42 private $linkBatchFactory;
45 private $wikiPageFactory;
48 private $redirectLookup;
62 parent::__construct(
'Listredirects' );
63 $this->linkBatchFactory = $linkBatchFactory;
65 $this->wikiPageFactory = $wikiPageFactory;
66 $this->redirectLookup = $redirectLookup;
83 'tables' => [
'p1' =>
'page',
'redirect',
'p2' =>
'page' ],
84 'fields' => [
'namespace' =>
'p1.page_namespace',
85 'title' =>
'p1.page_title',
90 'redirid' =>
'p2.page_id' ],
91 'conds' => [
'p1.page_is_redirect' => 1 ],
92 'join_conds' => [
'redirect' => [
93 'LEFT JOIN',
'rd_from=p1.page_id' ],
94 'p2' => [
'LEFT JOIN', [
95 'p2.page_namespace=rd_namespace',
96 'p2.page_title=rd_title' ] ] ]
101 return [
'p1.page_namespace',
'p1.page_title' ];
111 if ( !
$res->numRows() ) {
115 $batch = $this->linkBatchFactory->newLinkBatch();
116 foreach (
$res as $row ) {
117 $batch->add( $row->namespace, $row->title );
119 if ( $redirTarget ) {
120 $batch->addObj( $redirTarget );
134 if ( isset( $row->rd_title ) ) {
135 return Title::makeTitle(
138 $row->rd_fragment ??
'',
139 $row->rd_interwiki ??
''
142 $title = Title::makeTitle( $row->namespace, $row->title );
143 if ( !
$title->canExist() ) {
147 return Title::castFromLinkTarget(
148 $this->redirectLookup->getRedirectTarget(
$title )
160 # Make a link to the redirect itself
161 $rd_title = Title::makeTitle( $result->namespace, $result->title );
162 $rd_link = $linkRenderer->makeLink(
166 [
'redirect' =>
'no' ]
169 # Find out where the redirect leads
172 # Make a link to the destination page
174 $arr =
$lang->getArrow() .
$lang->getDirMark();
175 $targetLink = $linkRenderer->makeLink( $target, $target->getFullText() );
177 return "$rd_link $arr $targetLink";
179 return "<del>$rd_link</del>";
185 parent::execute( $par );
Service for creating WikiPage objects.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDBLoadBalancer(ILoadBalancer $loadBalancer)
Special:Listredirects - Lists all the redirects on the wiki.
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer, WikiPageFactory $wikiPageFactory, RedirectLookup $redirectLookup)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
execute( $par)
This is the actual workhorse.
formatResult( $skin, $result)
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
preprocessResults( $db, $res)
Cache page existence for performance.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
isExpensive()
Should this query page only be updated offline on large wikis?
getOrderFields()
Subclasses return an array of fields to order by here.
sortDescending()
Override to sort by increasing values.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Service for resolving a wiki page redirect.
if(!isset( $args[0])) $lang