Migrage callers away from SiteStatsUpdate::__construct()
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 11 Feb 2018 19:49:27 +0000 (11:49 -0800)
committerKrinkle <krinklemail@gmail.com>
Tue, 13 Feb 2018 03:48:36 +0000 (03:48 +0000)
Change-Id: I4d81f5f87c93865e8fe1b7986074070376eab8f9

includes/installer/Installer.php
includes/page/WikiPage.php

index f22b63d..dbd143c 100644 (file)
@@ -1564,7 +1564,7 @@ abstract class Installer {
                        $user->saveSettings();
 
                        // Update user count
-                       $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+                       $ssUpdate = SiteStatsUpdate::factory( [ 'users' => 1 ] );
                        $ssUpdate->doUpdate();
                }
                $status = Status::newGood();
index a7eed5a..c7bb8ec 100644 (file)
@@ -2271,7 +2271,9 @@ class WikiPage implements Page, IDBAccessObject {
                $edits = $options['changed'] ? 1 : 0;
                $total = $options['created'] ? 1 : 0;
 
-               DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
+               DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
+                       [ 'edits' => $edits, 'articles' => $good, 'total' => $total ]
+               ) );
                DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
 
                // If this is another user's talk page, update newtalk.
@@ -3018,7 +3020,9 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                // Update site status
-               DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$countable, -1 ) );
+               DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
+                       [ 'edits' => 1, 'articles' => -$countable, 'pages' => -1 ]
+               ) );
 
                // Delete pagelinks, update secondary indexes, etc
                $updates = $this->getDeletionUpdates( $content );