X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FnukePage.php;h=9e0971a524e3d261f14e72489364ccb4fdac0eb5;hb=7afced64454ad30d688540f7626448ac2faefebb;hp=ff821cc5e355cec22fa82dd65f5076ebd09c6e9b;hpb=5d4099246e49ff3e2b369e329aaaf3286f883bcd;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php index ff821cc5e3..9e0971a524 100644 --- a/maintenance/nukePage.php +++ b/maintenance/nukePage.php @@ -39,8 +39,8 @@ class NukePage extends Maintenance { } public function execute() { - $name = $this->getArg(); - $delete = $this->getOption( 'delete', false ); + $name = $this->getArg( 0 ); + $delete = $this->hasOption( 'delete' ); $dbw = $this->getDB( DB_MASTER ); $this->beginTransaction( $dbw, __METHOD__ ); @@ -92,7 +92,11 @@ class NukePage extends Maintenance { if ( $delete ) { $this->output( "Updating site stats..." ); $ga = $isGoodArticle ? -1 : 0; // if it was good, decrement that too - $stats = new SiteStatsUpdate( 0, -$count, $ga, -1 ); + $stats = SiteStatsUpdate::factory( [ + 'edits' => -$count, + 'articles' => $ga, + 'pages' => -1 + ] ); $stats->doUpdate(); $this->output( "done.\n" ); } @@ -115,5 +119,5 @@ class NukePage extends Maintenance { } } -$maintClass = "NukePage"; +$maintClass = NukePage::class; require_once RUN_MAINTENANCE_IF_MAIN;