61 parent::__construct(
'Listredirects' );
82 'tables' => [
'p1' =>
'page',
'redirect',
'p2' =>
'page' ],
83 'fields' => [
'namespace' =>
'p1.page_namespace',
84 'title' =>
'p1.page_title',
89 'redirid' =>
'p2.page_id' ],
90 'conds' => [
'p1.page_is_redirect' => 1 ],
91 'join_conds' => [
'redirect' => [
92 'LEFT JOIN',
'rd_from=p1.page_id' ],
93 'p2' => [
'LEFT JOIN', [
94 'p2.page_namespace=rd_namespace',
95 'p2.page_title=rd_title' ] ] ]
100 return [
'p1.page_namespace',
'p1.page_title' ];
110 if ( !
$res->numRows() ) {
114 $batch = $this->linkBatchFactory->newLinkBatch();
115 foreach (
$res as $row ) {
116 $batch->add( $row->namespace, $row->title );
118 if ( $redirTarget ) {
119 $batch->addObj( $redirTarget );
133 if ( isset( $row->rd_title ) ) {
137 $row->rd_fragment ??
'',
138 $row->rd_interwiki ??
''
142 if ( !
$title->canExist() ) {
147 $this->redirectLookup->getRedirectTarget(
$title )
159 # Make a link to the redirect itself
165 [
'redirect' =>
'no' ]
168 # Find out where the redirect leads
171 # Make a link to the destination page
173 $arr =
$lang->getArrow() .
$lang->getDirMark();
174 $targetLink =
$linkRenderer->makeLink( $target, $target->getFullText() );
176 return "$rd_link $arr $targetLink";
178 return "<del>$rd_link</del>";
184 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)
ILoadBalancer null $loadBalancer
Special:Listredirects - Lists all the redirects on the wiki.
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer, WikiPageFactory $wikiPageFactory, RedirectLookup $redirectLookup)
WikiPageFactory $wikiPageFactory
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
execute( $par)
This is the actual workhorse.
RedirectLookup $redirectLookup
formatResult( $skin, $result)
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
preprocessResults( $db, $res)
Cache page existence for performance.
LinkBatchFactory $linkBatchFactory
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
getOrderFields()
Subclasses return an array of fields to order by here.
sortDescending()
Override to sort by increasing values.
LinkRenderer null $linkRenderer
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
static castFromLinkTarget( $linkTarget)
Same as newFromLinkTarget, but if passed null, returns null.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Service for resolving a wiki page redirect.
if(!isset( $args[0])) $lang