15require_once __DIR__ .
'/Maintenance.php';
25 parent::__construct();
30 $this->
output(
"Fetching redirects...\n" );
32 $result = $dbr->newSelectQueryBuilder()
33 ->select( [
'page_namespace',
'page_title',
'page_latest' ] )
35 ->where( [
'page_is_redirect' => 1 ] )
36 ->caller( __METHOD__ )
39 $count = $result->numRows();
40 $this->
output(
"Found $count redirects.\n" .
41 "Checking for bad redirects:\n\n" );
44 foreach ( $result as $row ) {
45 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
46 $revRecord = $revLookup->getRevisionById( $row->page_latest );
48 $target = $revRecord->getContent( SlotRecord::MAIN )->getRedirectTarget();
50 $this->
output( $title->getPrefixedText() .
"\n" );
54 $this->
output(
"\nDone.\n" );
60require_once RUN_MAINTENANCE_IF_MAIN;
Maintenance script to check that pages marked as being redirects really are.
execute()
Do the actual work.
__construct()
Default constructor.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
getReplicaDB(string|false $virtualDomain=false)
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.