jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380146 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
......................................................................


build: Updating mediawiki/mediawiki-codesniffer to 13.0.0

Change-Id: I709acaff04a876e89e73b95a337ddfb0a9c0c5f6
---
M backend/FRDependencyUpdate.php
M backend/FRExtraCacheUpdate.php
M backend/FRExtraCacheUpdateJob.php
M backend/FRPageConfig.php
M backend/FRUserActivity.php
M backend/FRUserCounters.php
M backend/FlaggableWikiPage.php
M backend/FlaggedRevision.php
M backend/FlaggedRevs.hooks.php
M backend/FlaggedRevsStats.php
M business/RevisionReviewForm.php
M composer.json
M frontend/FlaggablePageView.php
M frontend/FlaggedRevsUI.hooks.php
M frontend/RejectConfirmationFormUI.php
M frontend/specialpages/reports/ProblemChanges_body.php
M frontend/specialpages/reports/QualityOversight_body.php
M frontend/specialpages/reports/UnreviewedPages_body.php
M frontend/specialpages/reports/ValidationStatistics_body.php
M maintenance/cachePendingRevs.php
M maintenance/clearCachedText.php
M maintenance/updateAutoPromote.php
M tests/FlaggablePageTest.php
23 files changed, 51 insertions(+), 51 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/backend/FRDependencyUpdate.php b/backend/FRDependencyUpdate.php
index fb658ed..753ecc4 100644
--- a/backend/FRDependencyUpdate.php
+++ b/backend/FRDependencyUpdate.php
@@ -100,7 +100,7 @@
         */
        protected function getExistingDeps( $flags = 0 ) {
                $db = ( $flags & FR_MASTER ) ?
-                       wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                       wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                $res = $db->select( 'flaggedrevs_tracking',
                        [ 'ftr_namespace', 'ftr_title' ],
                        [ 'ftr_from' => $this->title->getArticleID() ],
@@ -180,7 +180,7 @@
         * @return array (ns => dbKey => 1)
         */
        protected function getCurrentVersionLinks() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'pagelinks',
                        [ 'pl_namespace', 'pl_title' ],
                        [ 'pl_from' => $this->title->getArticleID() ],
@@ -201,7 +201,7 @@
         * @return array (ns => dbKey => 1)
         */
        protected function getCurrentVersionTemplates() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'templatelinks',
                        [ 'tl_namespace', 'tl_title' ],
                        [ 'tl_from' => $this->title->getArticleID() ],
@@ -222,7 +222,7 @@
         * @return array (dbKey => 1)
         */
        protected function getCurrentVersionImages() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'imagelinks',
                        [ 'il_to' ],
                        [ 'il_from' => $this->title->getArticleID() ],
@@ -240,7 +240,7 @@
         * @return array (category => sortkey)
         */
        protected function getCurrentVersionCategories() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'categorylinks',
                        [ 'cl_to', 'cl_sortkey' ],
                        [ 'cl_from' => $this->title->getArticleID() ],
diff --git a/backend/FRExtraCacheUpdate.php b/backend/FRExtraCacheUpdate.php
index 9e27e55..02bb380 100644
--- a/backend/FRExtraCacheUpdate.php
+++ b/backend/FRExtraCacheUpdate.php
@@ -21,7 +21,7 @@
 
        public function doUpdate() {
                # Fetch the IDs
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( $this->mTable, $this->getFromField(),
                        $this->getToCondition(), __METHOD__ );
                # Check if there is anything to do...
diff --git a/backend/FRExtraCacheUpdateJob.php 
b/backend/FRExtraCacheUpdateJob.php
index 8d5da7c..cf342e4 100644
--- a/backend/FRExtraCacheUpdateJob.php
+++ b/backend/FRExtraCacheUpdateJob.php
@@ -41,7 +41,7 @@
                        $conds[] = "$fromField <= {$this->params['end']}";
                }
                # Run query to get page Ids
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( $this->params['table'], $fromField, 
$conds, __METHOD__ );
                # Invalidate the pages
                $update->invalidateIDs( $res );
diff --git a/backend/FRPageConfig.php b/backend/FRPageConfig.php
index 1d39f47..96cabe2 100644
--- a/backend/FRPageConfig.php
+++ b/backend/FRPageConfig.php
@@ -11,7 +11,7 @@
         */
        public static function getStabilitySettings( Title $title, $flags = 0 ) 
{
                $db = ( $flags & FR_MASTER ) ?
-                       wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                       wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                $row = $db->selectRow( 'flaggedpage_config',
                        self::selectFields(),
                        [ 'fpc_page_id' => $title->getArticleID() ],
@@ -33,7 +33,7 @@
         */
        public static function getVisibilitySettingsFromRow( $row ) {
                if ( $row ) {
-                       $expiry = wfGetDB( DB_SLAVE )->decodeExpiry( 
$row->fpc_expiry );
+                       $expiry = wfGetDB( DB_REPLICA )->decodeExpiry( 
$row->fpc_expiry );
                        # Only apply the settings if they haven't expired
                        if ( !$expiry || $expiry < wfTimestampNow() ) {
                                $row = null; // expired
diff --git a/backend/FRUserActivity.php b/backend/FRUserActivity.php
index fd1dc7c..b3a086e 100644
--- a/backend/FRUserActivity.php
+++ b/backend/FRUserActivity.php
@@ -22,7 +22,7 @@
                }
 
                # Get number of active editors watching this page...
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $count = (int)$dbr->selectField(
                        [ 'watchlist', 'user' ],
                        'COUNT(*)',
diff --git a/backend/FRUserCounters.php b/backend/FRUserCounters.php
index cdba35a..fb648a5 100644
--- a/backend/FRUserCounters.php
+++ b/backend/FRUserCounters.php
@@ -69,7 +69,7 @@
                                $options[] = 'FOR UPDATE';
                        }
                } else {
-                       $db = wfGetDB( DB_SLAVE, [], $dBName );
+                       $db = wfGetDB( DB_REPLICA, [], $dBName );
                }
                return $db->selectRow( 'flaggedrevs_promote',
                        'frp_user_params',
diff --git a/backend/FlaggableWikiPage.php b/backend/FlaggableWikiPage.php
index 0fcad83..fcb1fc2 100644
--- a/backend/FlaggableWikiPage.php
+++ b/backend/FlaggableWikiPage.php
@@ -146,7 +146,7 @@
                # Otherwise, fetch result from DB as needed...
                if ( is_null( $count ) ) {
                        $db = ( $flags & FR_MASTER ) ?
-                               wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                               wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                        $srevTS = $db->timestamp( $srev->getRevTimestamp() );
                        $count = $db->selectField( 'revision', 'COUNT(*)',
                                [ 'rev_page' => $this->getId(),
@@ -316,7 +316,7 @@
         * @return int
         */
        public function getBestFlaggedRevId() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                # Get the highest quality revision (not necessarily this one).
                $oldid = $dbr->selectField( [ 'flaggedrevs', 'revision' ],
                        'fr_rev_id',
@@ -387,7 +387,7 @@
                if ( $data === 'fromdb' || $data === 'fromdbmaster' ) {
                        $db = ( $data == 'fromdbmaster' )
                                ? wfGetDB( DB_MASTER )
-                               : wfGetDB( DB_SLAVE );
+                               : wfGetDB( DB_REPLICA );
                        $data = $this->pageDataFromTitle( $db, $this->mTitle );
                }
                # Load in primary page data...
diff --git a/backend/FlaggedRevision.php b/backend/FlaggedRevision.php
index 4c47092..3e8922a 100644
--- a/backend/FlaggedRevision.php
+++ b/backend/FlaggedRevision.php
@@ -112,7 +112,7 @@
                        }
                        $pageId = $title->getArticleID( Title::GAID_FOR_UPDATE 
);
                } else {
-                       $db = wfGetDB( DB_SLAVE );
+                       $db = wfGetDB( DB_REPLICA );
                        $pageId = $title->getArticleID();
                }
                if ( !$pageId || !$revId ) {
@@ -162,7 +162,7 @@
                        }
                        $pageId = $title->getArticleID( Title::GAID_FOR_UPDATE 
);
                } else {
-                       $db = wfGetDB( DB_SLAVE );
+                       $db = wfGetDB( DB_REPLICA );
                        $pageId = $title->getArticleID();
                }
                if ( !$pageId ) {
@@ -206,7 +206,7 @@
                                $options[] = 'FOR UPDATE';
                        }
                } else {
-                       $db = wfGetDB( DB_SLAVE );
+                       $db = wfGetDB( DB_REPLICA );
                }
                if ( !$revId ) {
                        return null; // short-circuit query
@@ -268,7 +268,7 @@
                        }
                        $pageId = $title->getArticleID( Title::GAID_FOR_UPDATE 
);
                } else {
-                       $db = wfGetDB( DB_SLAVE );
+                       $db = wfGetDB( DB_REPLICA );
                        $pageId = $title->getArticleID();
                }
                if ( !$pageId ) {
@@ -570,7 +570,7 @@
                if ( $this->mTemplates == null ) {
                        $this->mTemplates = [];
                        $db = ( $flags & FR_MASTER ) ?
-                               wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                               wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                        $res = $db->select( 'flaggedtemplates',
                                [ 'ft_namespace', 'ft_title', 'ft_tmp_rev_id' ],
                                [ 'ft_rev_id' => $this->getRevId() ],
@@ -596,7 +596,7 @@
                if ( $this->mFiles == null ) {
                        $this->mFiles = [];
                        $db = ( $flags & FR_MASTER ) ?
-                               wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                               wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                        $res = $db->select( 'flaggedimages',
                                [ 'fi_name', 'fi_img_timestamp', 'fi_img_sha1' 
],
                                [ 'fi_rev_id' => $this->getRevId() ],
@@ -627,7 +627,7 @@
                if ( $this->mStableTemplates == null ) {
                        $this->mStableTemplates = [];
                        $db = ( $flags & FR_MASTER ) ?
-                               wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                               wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                        $res = $db->select(
                                [ 'flaggedtemplates', 'page', 'flaggedpages' ],
                                [ 'ft_namespace', 'ft_title', 'fp_stable' ],
@@ -661,7 +661,7 @@
                if ( $this->mStableFiles == null ) {
                        $this->mStableFiles = [];
                        $db = ( $flags & FR_MASTER ) ?
-                               wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                               wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                        $res = $db->select(
                                [ 'flaggedimages', 'page', 'flaggedpages', 
'flaggedrevs' ],
                                [ 'fi_name', 'fr_img_timestamp', 'fr_img_sha1' 
],
@@ -707,7 +707,7 @@
                if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
                        return []; // short-circuit
                }
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                # Only get templates with stable or "review time" versions.
                # Note: ft_tmp_rev_id is nullable (for deadlinks), so use 
ft_title
                if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) {
@@ -798,7 +798,7 @@
                if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
                        return []; // short-circuit
                }
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                # Only get templates with stable or "review time" versions.
                # Note: fi_img_timestamp is nullable (for deadlinks), so use 
fi_name
                if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) {
@@ -949,7 +949,7 @@
         */
        public static function getRevQuality( $rev_id, $flags = 0 ) {
                $db = ( $flags & FR_MASTER ) ?
-                       wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+                       wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
                return $db->selectField( 'flaggedrevs',
                        'fr_quality',
                        [ 'fr_rev_id' => $rev_id ],
diff --git a/backend/FlaggedRevs.hooks.php b/backend/FlaggedRevs.hooks.php
index 58f2698..2eaa3ae 100644
--- a/backend/FlaggedRevs.hooks.php
+++ b/backend/FlaggedRevs.hooks.php
@@ -729,7 +729,7 @@
                # Convert days to seconds...
                $spacingReq = $spacingReq * 24 * 3600;
                # Check the oldest edit
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $lower = $dbr->selectField( 'revision', 'rev_timestamp',
                        [ 'rev_user' => $user->getId() ],
                        __METHOD__,
@@ -768,7 +768,7 @@
         * @return bool
         */
        protected static function reviewedEditsCheck( User $user, $editsReq, 
$seconds = 0 ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                // Get cutoff timestamp (excludes edits that are too recent)
                $baseConds = [
                        'rev_user' => $user->getId(),
@@ -812,7 +812,7 @@
         * Checks if $user was previously blocked since $cutoff_unixtime
         */
        protected static function wasPreviouslyBlocked( User $user, 
$cutoff_unixtime = 0 ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $conds = [
                        'log_namespace' => NS_USER,
                        'log_title'     => $user->getUserPage()->getDBkey(),
@@ -828,7 +828,7 @@
        }
 
        protected static function recentEditCount( $uid, $seconds, $limit ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                # Get cutoff timestamp (edits that are too recent)
                $encCutoff = $dbr->addQuotes( $dbr->timestamp( time() - 
$seconds ) );
                # Check all recent edits...
@@ -841,7 +841,7 @@
        }
 
        protected static function recentContentEditCount( $uid, $seconds, 
$limit ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                # Get cutoff timestamp (edits that are too recent)
                $encCutoff = $dbr->addQuotes( $dbr->timestamp( time() - 
$seconds ) );
                # Check all recent content edits...
diff --git a/backend/FlaggedRevsStats.php b/backend/FlaggedRevsStats.php
index 1d46391..ad41f19 100644
--- a/backend/FlaggedRevsStats.php
+++ b/backend/FlaggedRevsStats.php
@@ -26,7 +26,7 @@
                $data['pendingLag-average'] = '-';
                $data['statTimestamp'] = '-';
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                if ( $timestamp === false ) { // use latest
                        $timestamp = $dbr->selectField( 
'flaggedrevs_statistics', 'MAX(frs_timestamp)' );
                }
@@ -192,7 +192,7 @@
        private static function getPerNamespaceTotals() {
                $ns_total = $ns_reviewed = $ns_synced = [];
                // Get total, reviewed, and synced page count for each namespace
-               $dbr = wfGetDB( DB_SLAVE, 'vslow' );
+               $dbr = wfGetDB( DB_REPLICA, 'vslow' );
                $res = $dbr->select( [ 'page', 'flaggedpages' ],
                        [ 'page_namespace',
                                'COUNT(*) AS total',
@@ -218,7 +218,7 @@
        }
 
        private static function getMeanPendingEditTime() {
-               $dbr = wfGetDB( DB_SLAVE, 'vslow' );
+               $dbr = wfGetDB( DB_REPLICA, 'vslow' );
                $nowUnix = wfTimestamp( TS_UNIX ); // current time in UNIX TS
                $unixTimeCall = self::dbUnixTime( $dbr, 'fp_pending_since' );
                return (int)$dbr->selectField(
@@ -255,7 +255,7 @@
                $rPerTable = []; // review wait percentiles
                # Only go so far back...otherwise we will get garbage values 
due to
                # the fact that FlaggedRevs wasn't enabled until after a while.
-               $dbr = wfGetDB( DB_SLAVE, 'vslow' );
+               $dbr = wfGetDB( DB_REPLICA, 'vslow' );
                $installedUnix = (int)$dbr->selectField( 'logging',
                        self::dbUnixTime( $dbr, 'MIN(log_timestamp)' ),
                        [ 'log_type' => 'review' ]
diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 93452c5..094e10f 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -345,7 +345,7 @@
 
                        if ( $editStatus->isOK() && class_exists( 'EchoEvent' ) 
&& $editStatus->value['revision'] ) {
                                $affectedRevisions = []; // revid -> userid
-                               $revisions = wfGetDB( DB_SLAVE )->select(
+                               $revisions = wfGetDB( DB_REPLICA )->select(
                                        'revision',
                                        [ 'rev_id', 'rev_user' ],
                                        [
diff --git a/composer.json b/composer.json
index 7898723..d980e06 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
-               "mediawiki/mediawiki-codesniffer": "0.12.0",
+               "mediawiki/mediawiki-codesniffer": "13.0.0",
                "jakub-onderka/php-console-highlighter": "0.3.2"
        },
        "scripts": {
diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php
index b67c4d0..8e13744 100644
--- a/frontend/FlaggablePageView.php
+++ b/frontend/FlaggablePageView.php
@@ -890,7 +890,7 @@
                        // B/C, may be stored in associated image version 
metadata table
                        // @TODO: remove, updateTracking.php does this
                        if ( !$time ) {
-                               $dbr = wfGetDB( DB_SLAVE );
+                               $dbr = wfGetDB( DB_REPLICA );
                                $time = $dbr->selectField( 'flaggedimages',
                                        'fi_img_timestamp',
                                        [ 'fi_rev_id' => $frev->getRevId(),
diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php
index ac99e75..6393061 100644
--- a/frontend/FlaggedRevsUI.hooks.php
+++ b/frontend/FlaggedRevsUI.hooks.php
@@ -575,7 +575,7 @@
                # Quality level for old versions selected all at once.
                # Commons queries cannot be done all at once...
                if ( !$file->isOld() || !$file->isLocal() ) {
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $quality = $dbr->selectField( 'flaggedrevs', 
'fr_quality',
                                [ 'fr_img_sha1' => $file->getSha1(),
                                        'fr_img_timestamp' => $dbr->timestamp( 
$file->getTimestamp() ) ],
@@ -719,7 +719,7 @@
                $watchlist = SpecialPage::getTitleFor( 'Watchlist' );
                # Add notice to watchlist about pending changes...
                if ( $out->getTitle()->equals( $watchlist ) && $namespaces ) {
-                       $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); // consistency 
with watchlist
+                       $dbr = wfGetDB( DB_REPLICA, 'watchlist' ); // 
consistency with watchlist
                        $watchedOutdated = (bool)$dbr->selectField(
                                [ 'watchlist', 'page', 'flaggedpages' ],
                                '1', // existence
diff --git a/frontend/RejectConfirmationFormUI.php 
b/frontend/RejectConfirmationFormUI.php
index c92b25c..e5fab51 100644
--- a/frontend/RejectConfirmationFormUI.php
+++ b/frontend/RejectConfirmationFormUI.php
@@ -32,7 +32,7 @@
 
                $form = '<div class="plainlinks">';
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'revision',
                        Revision::selectFields(),
                        [
diff --git a/frontend/specialpages/reports/ProblemChanges_body.php 
b/frontend/specialpages/reports/ProblemChanges_body.php
index a55f982..ed449b1 100644
--- a/frontend/specialpages/reports/ProblemChanges_body.php
+++ b/frontend/specialpages/reports/ProblemChanges_body.php
@@ -265,7 +265,7 @@
         */
        protected static function getChangeTags( $pageId, $revId ) {
                $tags = [];
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select(
                        [ 'revision', 'change_tag' ],
                        'DISTINCT(ct_tag)', // unique tags
diff --git a/frontend/specialpages/reports/QualityOversight_body.php 
b/frontend/specialpages/reports/QualityOversight_body.php
index eb13c95..be429e0 100644
--- a/frontend/specialpages/reports/QualityOversight_body.php
+++ b/frontend/specialpages/reports/QualityOversight_body.php
@@ -34,7 +34,7 @@
                $conds = [ 'log_namespace' => $this->namespace, 'log_action' => 
$actions ];
                # Get cutoff time (mainly for performance)
                if ( !$u ) {
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $cutoff_unixtime = time() - $wgFlaggedRevsOversightAge;
                        $cutoff = $dbr->addQuotes( $dbr->timestamp( 
$cutoff_unixtime ) );
                        $conds[] = "log_timestamp >= $cutoff";
diff --git a/frontend/specialpages/reports/UnreviewedPages_body.php 
b/frontend/specialpages/reports/UnreviewedPages_body.php
index faaf8f4..248887a 100644
--- a/frontend/specialpages/reports/UnreviewedPages_body.php
+++ b/frontend/specialpages/reports/UnreviewedPages_body.php
@@ -76,7 +76,7 @@
 
                # Query may get too slow to be live...
                if ( !$this->live ) {
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $ts = $dbr->selectField( 'querycache_info', 
'qci_timestamp',
                                [ 'qci_type' => 'fr_unreviewedpages' ], 
__METHOD__ );
                        if ( $ts ) {
@@ -182,7 +182,7 @@
                        return true;
                }
                # Get est. of fraction of pages that are reviewed
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $reviewedpages = $dbr->estimateRowCount( 'flaggedpages', '*', 
[], __METHOD__ );
                $pages = $dbr->estimateRowCount( 'page', '*',
                        [ 'page_namespace' => $namespaces ],
@@ -202,7 +202,7 @@
                if ( empty( $rNamespaces ) ) {
                        return;
                }
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $insertRows = [];
                // Find pages that were never reviewed at all...
diff --git a/frontend/specialpages/reports/ValidationStatistics_body.php 
b/frontend/specialpages/reports/ValidationStatistics_body.php
index 210c2ce..6f4500d 100644
--- a/frontend/specialpages/reports/ValidationStatistics_body.php
+++ b/frontend/specialpages/reports/ValidationStatistics_body.php
@@ -14,7 +14,7 @@
                $lang = $this->getLanguage();
 
                $this->setHeaders();
-               $this->db = wfGetDB( DB_SLAVE );
+               $this->db = wfGetDB( DB_REPLICA );
 
                $this->maybeUpdate();
 
@@ -315,7 +315,7 @@
                        return $data; // cache hit
                }
 
-               $dbr = wfGetDB( DB_SLAVE, 'vslow' );
+               $dbr = wfGetDB( DB_REPLICA, 'vslow' );
                $limit = (int)$wgFlaggedRevsStats['topReviewersCount'];
                $seconds = 3600 * $wgFlaggedRevsStats['topReviewersHours'];
                $cutoff = $dbr->timestamp( time() - $seconds );
diff --git a/maintenance/cachePendingRevs.php b/maintenance/cachePendingRevs.php
index 67b89de..460689f 100644
--- a/maintenance/cachePendingRevs.php
+++ b/maintenance/cachePendingRevs.php
@@ -22,7 +22,7 @@
 
        public function execute() {
                global $wgUser;
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $ret = $dbr->select(
                        [ 'flaggedpages', 'revision', 'page' ],
                        array_merge( Revision::selectFields(), [ 
$dbr->tableName( 'page' ) . '.*' ] ),
diff --git a/maintenance/clearCachedText.php b/maintenance/clearCachedText.php
index 1b17cc2..0fd7f44 100644
--- a/maintenance/clearCachedText.php
+++ b/maintenance/clearCachedText.php
@@ -14,7 +14,7 @@
 $pageId = 0;
 $revId = 0;
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 $batchSize = 1000;
 $maxPage = $dbr->selectField( 'flaggedrevs', 'MAX(fr_page_id)', '', __METHOD__ 
);
diff --git a/maintenance/updateAutoPromote.php 
b/maintenance/updateAutoPromote.php
index 5ad34a1..953e5e4 100644
--- a/maintenance/updateAutoPromote.php
+++ b/maintenance/updateAutoPromote.php
@@ -23,7 +23,7 @@
                $this->output( "Populating and updating flaggedrevs_promote 
table\n" );
 
                $commentQuery = CommentStore::newKey( 'rev_comment' 
)->getJoin();
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $dbw = wfGetDB( DB_MASTER );
                $start = $dbr->selectField( 'user', 'MIN(user_id)', false, 
__METHOD__ );
                $end = $dbr->selectField( 'user', 'MAX(user_id)', false, 
__METHOD__ );
diff --git a/tests/FlaggablePageTest.php b/tests/FlaggablePageTest.php
index 4c73786..1c3a2c2 100644
--- a/tests/FlaggablePageTest.php
+++ b/tests/FlaggablePageTest.php
@@ -35,7 +35,7 @@
                        $user
                );
 
-               $data = (array)$article->pageDataFromTitle( wfGetDB( DB_SLAVE 
), $title );
+               $data = (array)$article->pageDataFromTitle( wfGetDB( DB_REPLICA 
), $title );
 
                $this->assertEquals( true, array_key_exists( 'fpc_override', 
$data ),
                        "data->fpc_override field exists" );

-- 
To view, visit https://gerrit.wikimedia.org/r/380146
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I709acaff04a876e89e73b95a337ddfb0a9c0c5f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to