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

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


build: Updating mediawiki/mediawiki-codesniffer to 13.0.0

The following sniffs are failing and were disabled:
* MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle

Change-Id: I3c9e3197329b29dfd1d4751119b5a70361627c17
---
M api/ApiFeedLQTThreads.php
M api/ApiQueryLQTThreads.php
M classes/Dispatch.php
M classes/HistoricalThread.php
M classes/Hooks.php
M classes/NewMessagesController.php
M classes/Thread.php
M classes/ThreadRevision.php
M classes/Threads.php
M classes/View.php
M composer.json
M pages/NewUserMessagesView.php
M phpcs.xml
13 files changed, 36 insertions(+), 35 deletions(-)

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



diff --git a/api/ApiFeedLQTThreads.php b/api/ApiFeedLQTThreads.php
index 24ad88e..3e4a900 100644
--- a/api/ApiFeedLQTThreads.php
+++ b/api/ApiFeedLQTThreads.php
@@ -45,7 +45,7 @@
 
                $params = $this->extractRequestParams();
 
-               $db = wfGetDB( DB_SLAVE );
+               $db = wfGetDB( DB_REPLICA );
 
                $feedTitle = $this->createFeedTitle( $params );
                $feedClass = $wgFeedClasses[$params['feedformat']];
diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php
index c1d1325..404e73d 100644
--- a/api/ApiQueryLQTThreads.php
+++ b/api/ApiQueryLQTThreads.php
@@ -172,7 +172,7 @@
        protected function addSubItems(
                $tableName, $fields, $joinField, $subitemName, /*callable*/ 
$handleRow, $tagName
        ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $result = $this->getResult();
 
                $fields = array_merge( (array)$fields, (array)$joinField );
diff --git a/classes/Dispatch.php b/classes/Dispatch.php
index e8ffb01..74d2c5a 100644
--- a/classes/Dispatch.php
+++ b/classes/Dispatch.php
@@ -181,7 +181,7 @@
                }
 
                // Load from the database.
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $row = $dbr->selectRow(
                        'page_props',
diff --git a/classes/HistoricalThread.php b/classes/HistoricalThread.php
index 03c351d..ccf07a4 100644
--- a/classes/HistoricalThread.php
+++ b/classes/HistoricalThread.php
@@ -40,7 +40,7 @@
        }
 
        static function withIdAtRevision( $id, $rev ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $line = $dbr->selectRow(
                        'historical_thread',
                        'hthread_contents',
diff --git a/classes/Hooks.php b/classes/Hooks.php
index b960759..9dcd91d 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -117,7 +117,7 @@
                        return true;
                }
 
-               $db = wfGetDB( DB_SLAVE );
+               $db = wfGetDB( DB_REPLICA );
 
                if ( !in_array( 'page', $tables ) ) {
                        $tables[] = 'page';
@@ -253,7 +253,7 @@
 
                $join_conds['thread'] = [ 'left join', [ 'thread_root=page_id' 
] ];
 
-               $db = wfGetDB( DB_SLAVE );
+               $db = wfGetDB( DB_REPLICA );
                $fields[] = $db->tableName( 'thread' ) . '.*';
 
                return true;
diff --git a/classes/NewMessagesController.php 
b/classes/NewMessagesController.php
index 1a89929..1ab126e 100644
--- a/classes/NewMessagesController.php
+++ b/classes/NewMessagesController.php
@@ -131,7 +131,7 @@
                ];
                $fields = [ 'wl_user', 'ums_user', 'ums_read_timestamp', 
'up_value' ];
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                return $dbr->select( $tables, $fields, self::getWhereClause( $t 
), __METHOD__, [], $joins );
        }
 
@@ -256,7 +256,7 @@
                }
 
                // Send email notification, fetching all the data in one go
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $tables = [
                        'user',
@@ -347,7 +347,7 @@
        static function newUserMessages( $user ) {
                $talkPage = new Article( $user->getUserPage()->getTalkPage(), 0 
);
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $joinConds = [ 'ums_user' => null ];
                $joinConds[] = $dbr->makeList(
@@ -377,7 +377,7 @@
                return Threads::loadFromResult( $res, $dbr );
        }
 
-       static function newMessageCount( $user, $db = DB_SLAVE ) {
+       static function newMessageCount( $user, $db = DB_REPLICA ) {
                global $wgMemc;
 
                $cval = $wgMemc->get( wfMemcKey( 'lqt-new-messages-count', 
$user->getId() ) );
@@ -419,7 +419,7 @@
        static function watchedThreadsForUser( $user ) {
                $talkPage = new Article( $user->getUserPage()->getTalkPage(), 0 
);
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $res = $dbr->select(
                        [ 'thread', 'user_message_state' ],
diff --git a/classes/Thread.php b/classes/Thread.php
index fdc3f47..510710e 100644
--- a/classes/Thread.php
+++ b/classes/Thread.php
@@ -465,7 +465,7 @@
                // Populate reply count
                if ( $this->replyCount == - 1 ) {
                        if ( $this->isTopmostThread() ) {
-                               $dbr = wfGetDB( DB_SLAVE );
+                               $dbr = wfGetDB( DB_REPLICA );
 
                                $count = $dbr->selectField( 'thread', 
'count(*)',
                                        [ 'thread_ancestor' => $this->id() ], 
__METHOD__ );
@@ -514,7 +514,7 @@
                /* SCHEMA changes must be reflected here. */
 
                if ( is_null( $line ) ) { // For Thread::create().
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $this->modified = $dbr->timestamp( wfTimestampNow() );
                        $this->created = $dbr->timestamp( wfTimestampNow() );
                        $this->sortkey = wfTimestamp( TS_MW );
@@ -594,7 +594,7 @@
                $userIds = [];
                $loadEditorsFor = [];
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                if ( !is_array( self::$replyCacheById ) ) {
                        self::$replyCacheById = [];
@@ -769,7 +769,7 @@
        public function loadOriginalAuthorFromRevision() {
                $this->dieIfHistorical();
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $article = $this->root();
 
@@ -1034,7 +1034,7 @@
 
                $this->replies = [];
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $res = $dbr->select( 'thread', '*',
                                        [ 'thread_parent' => $this->id(),
@@ -1428,7 +1428,7 @@
                        return null;
                }
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $revision = $this->topmostThread()->threadRevision;
                $timestamp = $dbr->timestamp( $revision->getTimestamp() );
@@ -1647,7 +1647,7 @@
                        // Load editors
                        $this->editors = [];
 
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $res = $dbr->select( 'revision', 'rev_user_text',
                                [ 'rev_page' => $this->root()->getId(),
                                'rev_parent_id != ' . $dbr->addQuotes( 0 ) ], 
__METHOD__ );
@@ -1685,7 +1685,7 @@
                        } else {
                                $reactions = [];
 
-                               $dbr = wfGetDB( DB_SLAVE );
+                               $dbr = wfGetDB( DB_REPLICA );
 
                                $res = $dbr->select( 'thread_reaction',
                                                [ 'tr_thread' => $this->id() ],
diff --git a/classes/ThreadRevision.php b/classes/ThreadRevision.php
index 313d40b..776ab19 100644
--- a/classes/ThreadRevision.php
+++ b/classes/ThreadRevision.php
@@ -21,7 +21,7 @@
                                $mChangeObjectId, $mChangeObject, 
$mChangeComment, $mObjSer, $mThreadObj;
 
        public static function loadFromId( $id ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $row = $dbr->selectRow( 'thread_history', '*', [ 'th_id' => $id 
], __METHOD__ );
 
                if ( !$row ) {
@@ -191,7 +191,7 @@
        }
 
        public function prev() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $cond = 'th_id<' . $dbr->addQuotes( intval( $this->getId() ) );
                $row = $dbr->selectRow( 'thread_history', '*',
@@ -202,7 +202,7 @@
        }
 
        public function next() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $cond = 'th_id>' . $dbr->addQuotes( intval( $this->getId() ) );
                $row = $dbr->selectRow( 'thread_history', '*',
diff --git a/classes/Threads.php b/classes/Threads.php
index 0e27a3e..34156eb 100644
--- a/classes/Threads.php
+++ b/classes/Threads.php
@@ -95,7 +95,7 @@
        }
 
        public static function where( $where, $options = [], $bulkLoad = true ) 
{
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $res = $dbr->select( 'thread', '*', $where, __METHOD__, 
$options );
                $threads = self::loadFromResult( $res, $dbr, $bulkLoad );
@@ -183,7 +183,7 @@
        }
 
        public static function articleClause( $article ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $titleCond = [ 'thread_article_title' => 
$article->getTitle()->getDBKey(),
                        'thread_article_namespace' => 
$article->getTitle()->getNamespace() ];
@@ -200,7 +200,7 @@
        }
 
        public static function topLevelClause() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $arr = [ 'thread_ancestor=thread_id', 'thread_parent' => null ];
 
@@ -315,7 +315,7 @@
                        throw new Exception( "synchroniseArticleData called on 
null article" );
                }
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $dbw = wfGetDB( DB_MASTER );
 
                $title = $article->getTitle();
diff --git a/classes/View.php b/classes/View.php
index 3874349..2a83ab3 100644
--- a/classes/View.php
+++ b/classes/View.php
@@ -158,7 +158,7 @@
                if ( $contextType == 'page' ) {
                        $title = clone $thread->getTitle();
 
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $offset = $thread->topmostThread()->sortkey();
                        $offset = wfTimestamp( TS_UNIX, $offset ) + 1;
                        $offset = $dbr->timestamp( $offset );
@@ -672,7 +672,7 @@
                $wgRequest->setVal( 'wpSummary', $summary );
 
                // Add an offset so it works if it's on the wrong page.
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $offset = wfTimestamp( TS_UNIX, 
$thread->topmostThread()->sortkey() );
                $offset++;
                $offset = $dbr->timestamp( $offset );
@@ -788,7 +788,7 @@
                }
 
                // Add an offset so it works if it's on the wrong page.
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $offset = wfTimestamp( TS_UNIX, 
$thread->topmostThread()->sortkey() );
                $offset++;
                $offset = $dbr->timestamp( $offset );
@@ -880,7 +880,7 @@
                $e = new EditPage( $article );
 
                // Add an offset so it works if it's on the wrong page.
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $offset = wfTimestamp( TS_UNIX, 
$thread->topmostThread()->sortkey() );
                $offset++;
                $offset = $dbr->timestamp( $offset );
diff --git a/composer.json b/composer.json
index 0d6222c..c710fab 100644
--- a/composer.json
+++ b/composer.json
@@ -9,7 +9,7 @@
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "jakub-onderka/php-console-highlighter": "0.3.2",
-               "mediawiki/mediawiki-codesniffer": "0.12.0"
+               "mediawiki/mediawiki-codesniffer": "13.0.0"
        },
        "scripts": {
                "fix": "phpcbf",
diff --git a/pages/NewUserMessagesView.php b/pages/NewUserMessagesView.php
index 4802e23..d760e7d 100644
--- a/pages/NewUserMessagesView.php
+++ b/pages/NewUserMessagesView.php
@@ -163,7 +163,7 @@
 
                // Make sure it points to the right page. The Pager seems to 
use the DB
                // representation of a timestamp for its offset field, odd.
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $offset = wfTimestamp( TS_UNIX, $topmostThread->modified() ) + 
1;
                $offset = $dbr->timestamp( $offset );
                $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
@@ -224,7 +224,7 @@
                        $output[$id] = [ 'top' => $thread, 'posts' => [] ];
                }
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $res = $dbr->select( [ 'user_message_state' ],
                                        [ 'ums_thread', 'ums_conversation' ],
@@ -245,7 +245,7 @@
        }
 
        function getQueryInfo() {
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                $queryInfo = [
                        'tables' => [ 'thread', 'user_message_state' ],
diff --git a/phpcs.xml b/phpcs.xml
index 97b6e74..107aae8 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -14,7 +14,8 @@
                <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
                <exclude 
name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName"/>
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
-               <exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals"/>
+               <exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals" 
/>
+               <exclude 
name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle"
 />
        </rule>
        <rule ref="MediaWiki.NamingConventions.ValidGlobalName">
                <properties>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c9e3197329b29dfd1d4751119b5a70361627c17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to