From 331c9f9e2e59ee7a13e0da471f067f12b1915ea3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 11 Feb 2018 11:49:27 -0800 Subject: [PATCH] Migrage callers away from SiteStatsUpdate::__construct() Change-Id: I4d81f5f87c93865e8fe1b7986074070376eab8f9 --- includes/installer/Installer.php | 2 +- includes/page/WikiPage.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f22b63dbdb..dbd143c8e4 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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(); diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a7eed5a98b..c7bb8ecc62 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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 ); -- 2.20.1