38 private $contentHandlerFactory;
41 private $linkBatchFactory;
56 parent::__construct(
'DoubleRedirects' );
57 $this->contentHandlerFactory = $contentHandlerFactory;
58 $this->linkBatchFactory = $linkBatchFactory;
76 return $this->
msg(
'doubleredirectstext' )->parseAsBlock();
79 private function reallyGetQueryInfo( $namespace =
null,
$title =
null ) {
80 $limitToTitle = !( $namespace ===
null &&
$title === null );
89 'namespace' =>
'pa.page_namespace',
90 'title' =>
'pa.page_title',
92 'b_namespace' =>
'pb.page_namespace',
93 'b_title' =>
'pb.page_title',
94 'b_fragment' =>
'ra.rd_fragment',
98 'c_namespace' =>
'rb.rd_namespace',
99 'c_title' =>
'rb.rd_title',
100 'c_fragment' =>
'rb.rd_fragment',
101 'c_interwiki' =>
'rb.rd_interwiki',
104 'ra.rd_from = pa.page_id',
113 'ra.rd_interwiki IS NULL OR ra.rd_interwiki = ' . $this->dbr->addQuotes(
'' ),
115 'pb.page_namespace = ra.rd_namespace',
116 'pb.page_title = ra.rd_title',
118 'rb.rd_from = pb.page_id',
122 if ( $limitToTitle ) {
123 $retval[
'conds'][
'pa.page_namespace'] = $namespace;
124 $retval[
'conds'][
'pa.page_title'] =
$title;
131 return $this->reallyGetQueryInfo();
135 return [
'ra.rd_namespace',
'ra.rd_title' ];
151 if ( isset( $result->b_namespace ) ) {
154 $qi = $this->reallyGetQueryInfo(
158 $deep = $this->dbr->selectRow(
167 $titleA = Title::makeTitle( $result->namespace, $result->title );
171 return '<del>' . $linkRenderer->makeLink( $titleA,
null, [], [
'redirect' =>
'no' ] ) .
'</del>';
179 $this->contentHandlerFactory->getContentHandler( $titleA->getContentModel() )
180 ->supportsDirectEditing()
182 $edit = $linkRenderer->makeKnownLink(
184 $this->
msg(
'parentheses', $this->
msg(
'editlink' )->text() )->text(),
186 [
'action' =>
'edit' ]
192 $linkA = $linkRenderer->makeKnownLink(
196 [
'redirect' =>
'no' ]
199 $titleB = Title::makeTitle( $deep->b_namespace, $deep->b_title );
201 $titleBFrag = Title::makeTitle( $deep->b_namespace, $deep->b_title, $deep->b_fragment );
202 $linkB = $linkRenderer->makeKnownLink(
204 $titleBFrag->getFullText(),
206 [
'redirect' =>
'no' ]
209 $titleC = Title::makeTitle(
215 $linkC = $linkRenderer->makeKnownLink( $titleC, $titleC->getFullText() );
218 $arr =
$lang->getArrow() .
$lang->getDirMark();
220 return (
"{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
225 parent::execute( $par );
235 if ( !
$res->numRows() ) {
239 $batch = $this->linkBatchFactory->newLinkBatch();
240 foreach (
$res as $row ) {
241 $batch->add( $row->namespace, $row->title );
242 if ( isset( $row->b_namespace ) ) {
244 $batch->add( $row->b_namespace, $row->b_title );
246 if ( isset( $row->c_interwiki ) && !$row->c_interwiki ) {
248 $batch->add( $row->c_namespace, $row->c_title );
258 return 'maintenance';
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)
A special page listing redirects to redirecting page.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
preprocessResults( $db, $res)
Cache page content model and gender distinction for performance.
execute( $par)
This is the actual workhorse.
sortDescending()
Override to sort by increasing values.
isExpensive()
Should this query page only be updated offline on large wikis?
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
__construct(IContentHandlerFactory $contentHandlerFactory, LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer)
getPageHeader()
The content returned by this function will be output before any result.
formatResult( $skin, $result)
getOrderFields()
Subclasses return an array of fields to order by here.
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getAuthority()
Shortcut to get the Authority executing this instance.
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