39 private $contentHandlerFactory;
51 parent::__construct(
'BrokenRedirects' );
52 $this->contentHandlerFactory = $contentHandlerFactory;
70 return $this->
msg(
'brokenredirectstext' )->parseAsBlock();
83 'namespace' =>
'p1.page_namespace',
84 'title' =>
'p1.page_title',
94 'rd_interwiki IS NULL OR rd_interwiki = ' .
$dbr->addQuotes(
'' ),
95 'p2.page_namespace IS NULL',
101 'p2' => [
'LEFT JOIN', [
102 'rd_namespace=p2.page_namespace',
103 'rd_title=p2.page_title'
113 return [
'rd_namespace',
'rd_title',
'rd_from' ];
122 $fromObj = Title::makeTitle( $result->namespace, $result->title );
123 if ( isset( $result->rd_title ) ) {
124 $toObj = Title::makeTitle(
125 $result->rd_namespace,
127 $result->rd_fragment ??
''
130 $blinks = $fromObj->getBrokenLinksFrom(); # TODO: check
for redirect, not
for links
141 if ( !is_object( $toObj ) ) {
142 return '<del>' . $linkRenderer->makeLink( $fromObj ) .
'</del>';
145 $from = $linkRenderer->makeKnownLink(
149 [
'redirect' =>
'no' ]
157 $this->contentHandlerFactory->getContentHandler( $fromObj->getContentModel() )
158 ->supportsDirectEditing()
160 $links[] = $linkRenderer->makeKnownLink(
162 $this->
msg(
'brokenredirects-edit' )->text(),
164 [
'action' =>
'edit' ]
167 $to = $linkRenderer->makeBrokenLink( $toObj, $toObj->getFullText() );
170 $out = $from . $this->
msg(
'word-separator' )->escaped();
173 $links[] = $linkRenderer->makeKnownLink(
175 $this->
msg(
'brokenredirects-delete' )->text(),
178 'action' =>
'delete',
179 'wpReason' => $this->
msg(
'brokenredirects-delete-reason' )
180 ->inContentLanguage()
187 $out .= $this->
msg(
'parentheses' )->rawParams( $this->
getLanguage()
188 ->pipeList( $links ) )->escaped();
190 $out .=
" {$arr} {$to}";
197 parent::execute( $par );
211 return 'maintenance';
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
setDBLoadBalancer(ILoadBalancer $loadBalancer)
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
A special page listing redirects to non existent page.
preprocessResults( $db, $res)
Cache page content model for performance.
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
execute( $par)
This is the actual workhorse.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
sortDescending()
Override to sort by increasing values.
isExpensive()
Should this query page only be updated offline on large wikis?
formatResult( $skin, $result)
__construct(IContentHandlerFactory $contentHandlerFactory, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory)
getPageHeader()
The content returned by this function will be output before any result.
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.