55 parent::__construct(
'Listredirects' );
75 'tables' => [
'p1' =>
'page',
'redirect',
'p2' =>
'page' ],
76 'fields' => [
'namespace' =>
'p1.page_namespace',
77 'title' =>
'p1.page_title',
82 'redirid' =>
'p2.page_id' ],
83 'conds' => [
'p1.page_is_redirect' => 1 ],
84 'join_conds' => [
'redirect' => [
85 'LEFT JOIN',
'rd_from=p1.page_id' ],
86 'p2' => [
'LEFT JOIN', [
87 'p2.page_namespace=rd_namespace',
88 'p2.page_title=rd_title' ] ] ]
93 return [
'p1.page_namespace',
'p1.page_title' ];
103 if ( !
$res->numRows() ) {
107 $batch = $this->linkBatchFactory->newLinkBatch();
108 foreach (
$res as $row ) {
109 $batch->add( $row->namespace, $row->title );
111 if ( $redirTarget ) {
112 $batch->addObj( $redirTarget );
126 if ( isset( $row->rd_title ) ) {
127 return Title::makeTitle( $row->rd_namespace,
128 $row->rd_title, $row->rd_fragment,
132 $title = Title::makeTitle( $row->namespace, $row->title );
133 $page = $this->wikiPageFactory->newFromTitle(
$title );
135 return $page->getRedirectTarget();
146 # Make a link to the redirect itself
147 $rd_title = Title::makeTitle( $result->namespace, $result->title );
152 [
'redirect' =>
'no' ]
155 # Find out where the redirect leads
158 # Make a link to the destination page
160 $arr =
$lang->getArrow() .
$lang->getDirMark();
163 return "$rd_link $arr $targetLink";
165 return "<del>$rd_link</del>";
171 parent::execute( $par );
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.
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.
formatResult( $skin, $result)
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer, WikiPageFactory $wikiPageFactory)
isSyndicated()
Sometime 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.
if(!isset( $args[0])) $lang