Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / maintenance / nukePage.php
index e27324a..9e0971a 100644 (file)
@@ -39,7 +39,7 @@ class NukePage extends Maintenance {
        }
 
        public function execute() {
-               $name = $this->getArg();
+               $name = $this->getArg( 0 );
                $delete = $this->hasOption( 'delete' );
 
                $dbw = $this->getDB( DB_MASTER );
@@ -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;