Avoid using deprecated SiteStatsUpdate constructor
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 6 Jul 2019 06:26:17 +0000 (23:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 6 Jul 2019 06:26:17 +0000 (23:26 -0700)
Change-Id: I7eb02d1b91ee08049777c203502a4959dfa8f20f

maintenance/createAndPromote.php
maintenance/nukePage.php

index 93614e0..5ff3af1 100644 (file)
@@ -149,7 +149,7 @@ class CreateAndPromote extends Maintenance {
 
                if ( !$exists ) {
                        # Increment site_stats.ss_users
-                       $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+                       $ssu = SiteStatsUpdate::factory( [ 'users' => 1 ] );
                        $ssu->doUpdate();
                }
 
index ba0fe5d..9e0971a 100644 (file)
@@ -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" );
                        }