X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupCaps.php;h=641250d102646223b3d6565f3253fbd3f406c7a8;hb=071d62ea3cc9b3c3ac9f7efd4a0069f49b15c19d;hp=6234db48cacf118cc0adc5d1827277ae2ed44227;hpb=a75e07ccf58fe02fb6d0e452a46cc87f7d889fc7;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupCaps.php b/maintenance/cleanupCaps.php index 6234db48ca..641250d102 100644 --- a/maintenance/cleanupCaps.php +++ b/maintenance/cleanupCaps.php @@ -42,7 +42,7 @@ class CapsCleanup extends TableCleanup { public function __construct() { parent::__construct(); - $this->mDescription = "Script to cleanup capitalization"; + $this->addDescription( 'Script to cleanup capitalization' ); $this->addOption( 'namespace', 'Namespace number to run caps cleanup on', false, true ); } @@ -53,16 +53,16 @@ class CapsCleanup extends TableCleanup { $this->error( "\$wgCapitalLinks is on -- no need for caps links cleanup.", true ); } - $this->user = User::newFromName( 'Conversion script' ); + $this->user = User::newSystemUser( 'Conversion script', [ 'steal' => true ] ); $this->namespace = intval( $this->getOption( 'namespace', 0 ) ); $this->dryrun = $this->hasOption( 'dry-run' ); - $this->runTable( array( + $this->runTable( [ 'table' => 'page', - 'conds' => array( 'page_namespace' => $this->namespace ), + 'conds' => [ 'page_namespace' => $this->namespace ], 'index' => 'page_id', - 'callback' => 'processRow' ) ); + 'callback' => 'processRow' ] ); } protected function processRow( $row ) {