[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0

2017-09-24 Thread jenkins-bot (Code Review)
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( 

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0

2017-09-23 Thread Libraryupgrader (Code Review)
Libraryupgrader has uploaded a new change for review. ( 
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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/90/380190/1

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(