Merge "tests: Remove verbose logging settings from DevelopmentSettings.php"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index a7f53df..a47b001 100644 (file)
@@ -2269,9 +2269,11 @@ class WikiPage implements Page, IDBAccessObject {
                        $good = 0;
                }
                $edits = $options['changed'] ? 1 : 0;
-               $total = $options['created'] ? 1 : 0;
+               $pages = $options['created'] ? 1 : 0;
 
-               DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
+               DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
+                       [ 'edits' => $edits, 'articles' => $good, 'pages' => $pages ]
+               ) );
                DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
 
                // If this is another user's talk page, update newtalk.
@@ -2517,7 +2519,7 @@ class WikiPage implements Page, IDBAccessObject {
                        $cascade = false;
 
                        if ( $limit['create'] != '' ) {
-                               $commentFields = CommentStore::newKey( 'pt_reason' )->insert( $dbw, $reason );
+                               $commentFields = CommentStore::getStore()->insert( $dbw, 'pt_reason', $reason );
                                $dbw->replace( 'protected_titles',
                                        [ [ 'pt_namespace', 'pt_title' ] ],
                                        [
@@ -2844,8 +2846,7 @@ class WikiPage implements Page, IDBAccessObject {
                        $content = null;
                }
 
-               $revCommentStore = new CommentStore( 'rev_comment' );
-               $arCommentStore = new CommentStore( 'ar_comment' );
+               $commentStore = CommentStore::getStore();
 
                $revQuery = Revision::getQueryInfo();
                $bitfield = false;
@@ -2881,7 +2882,7 @@ class WikiPage implements Page, IDBAccessObject {
                $ipRevIds = [];
 
                foreach ( $res as $row ) {
-                       $comment = $revCommentStore->getComment( $row );
+                       $comment = $commentStore->getComment( 'rev_comment', $row );
                        $rowInsert = [
                                'ar_namespace'  => $namespace,
                                'ar_title'      => $dbKey,
@@ -2898,7 +2899,7 @@ class WikiPage implements Page, IDBAccessObject {
                                'ar_page_id'    => $id,
                                'ar_deleted'    => $suppress ? $bitfield : $row->rev_deleted,
                                'ar_sha1'       => $row->rev_sha1,
-                       ] + $arCommentStore->insert( $dbw, $comment );
+                       ] + $commentStore->insert( $dbw, 'ar_comment', $comment );
                        if ( $wgContentHandlerUseDB ) {
                                $rowInsert['ar_content_model'] = $row->rev_content_model;
                                $rowInsert['ar_content_format'] = $row->rev_content_format;
@@ -3019,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 );