X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcheckBadRedirects.php;h=b22432a0e7952832f07e4e45487274847b1ecbd5;hb=5db74eb56e425ba803b2cc936fbe3e5cc219b482;hp=a96e9b80dad33d7360c03055ea9e63921dbd0d81;hpb=5cfec935722d8f4015dc24cda1de8bfc7f330537;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/checkBadRedirects.php b/maintenance/checkBadRedirects.php index a96e9b80da..b22432a0e7 100644 --- a/maintenance/checkBadRedirects.php +++ b/maintenance/checkBadRedirects.php @@ -31,20 +31,20 @@ require_once __DIR__ . '/Maintenance.php'; class CheckBadRedirects extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Check for bad redirects"; + $this->addDescription( 'Check for bad redirects' ); } public function execute() { $this->output( "Fetching redirects...\n" ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $result = $dbr->select( - array( 'page' ), - array( 'page_namespace', 'page_title', 'page_latest' ), - array( 'page_is_redirect' => 1 ) ); + [ 'page' ], + [ 'page_namespace', 'page_title', 'page_latest' ], + [ 'page_is_redirect' => 1 ] ); $count = $result->numRows(); $this->output( "Found $count redirects.\n" . - "Checking for bad redirects:\n\n" ); + "Checking for bad redirects:\n\n" ); foreach ( $result as $row ) { $title = Title::makeTitle( $row->page_namespace, $row->page_title ); @@ -60,5 +60,5 @@ class CheckBadRedirects extends Maintenance { } } -$maintClass = "CheckBadRedirects"; +$maintClass = CheckBadRedirects::class; require_once RUN_MAINTENANCE_IF_MAIN;