29require_once __DIR__ .
'/Maintenance.php';
39 parent::__construct();
44 $this->
output(
"Fetching redirects...\n" );
46 $result = $dbr->newSelectQueryBuilder()
47 ->select( [
'page_namespace',
'page_title',
'page_latest' ] )
49 ->where( [
'page_is_redirect' => 1 ] )
50 ->caller( __METHOD__ )
53 $count = $result->numRows();
54 $this->
output(
"Found $count redirects.\n" .
55 "Checking for bad redirects:\n\n" );
58 foreach ( $result as $row ) {
59 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
60 $revRecord = $revLookup->getRevisionById( $row->page_latest );
62 $target = $revRecord->getContent( SlotRecord::MAIN )->getRedirectTarget();
64 $this->
output( $title->getPrefixedText() .
"\n" );
68 $this->
output(
"\nDone.\n" );
74require_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.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.