[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: use DB_REPLICA instead of deprecated DB_SLAVE

2016-09-19 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: use DB_REPLICA instead of deprecated DB_SLAVE
..


use DB_REPLICA instead of deprecated DB_SLAVE

Change-Id: I16ae082aeba0a5f40e913fec5e81157558954ab0
---
M includes/CentralAuthUser.php
M includes/CentralAuthUtils.php
M includes/GlobalRename/GlobalRenameRequest.php
M includes/GlobalRename/GlobalRenameUserStatus.php
M includes/LocalRenameJob/LocalRenameUserJob.php
M includes/specials/SpecialGlobalRenameQueue.php
M includes/specials/SpecialUsersWhoWillBeRenamed.php
M maintenance/checkLocalNames.php
M maintenance/checkLocalUser.php
M maintenance/fixStuckGlobalRename.php
M maintenance/migratePass0.php
M maintenance/migrateStewards.php
M maintenance/populateGlobalRenameLogSearch.php
13 files changed, 20 insertions(+), 20 deletions(-)

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



diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 0f543ae..52b0426 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2080,7 +2080,7 @@
function importLocalNames() {
$rows = [];
foreach ( self::getWikiList() as $wikiID ) {
-   $dbr = wfGetLB( $wikiID )->getConnectionRef( DB_SLAVE, 
array(), $wikiID );
+   $dbr = wfGetLB( $wikiID )->getConnectionRef( 
DB_REPLICA, array(), $wikiID );
$id = $dbr->selectField(
"`$wikiID`.`user`",
'user_id',
@@ -2334,7 +2334,7 @@
 */
protected function localUserData( $wikiID ) {
$lb = wfGetLB( $wikiID );
-   $db = $lb->getConnection( DB_SLAVE, array(), $wikiID );
+   $db = $lb->getConnection( DB_REPLICA, array(), $wikiID );
$fields = array(
'user_id',
'user_email',
diff --git a/includes/CentralAuthUtils.php b/includes/CentralAuthUtils.php
index 48b31a6..7ca4b49 100644
--- a/includes/CentralAuthUtils.php
+++ b/includes/CentralAuthUtils.php
@@ -62,7 +62,7 @@
global $wgCentralAuthDatabase;
 
return wfGetLB( $wgCentralAuthDatabase )->getConnection(
-   DB_SLAVE, 'centralauth', $wgCentralAuthDatabase );
+   DB_REPLICA, 'centralauth', $wgCentralAuthDatabase );
}
 
/**
diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index e096984..155dea4 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -321,7 +321,7 @@
 * @return stdClass|bool Row as object or false if not found
 */
protected static function fetchRowFromDB( array $where ) {
-   return self::getDB( DB_SLAVE )->selectRow(
+   return self::getDB( DB_REPLICA )->selectRow(
'renameuser_queue',
array(
'id'=> 'rq_id',
@@ -368,7 +368,7 @@
/**
 * Get a DatabaseBase object for the CentralAuth db
 *
-* @param int $type DB_SLAVE or DB_MASTER
+* @param int $type DB_REPLICA or DB_MASTER
 * @return DatabaseBase
 */
protected static function getDB( $type ) {
@@ -386,7 +386,7 @@
 * @return bool
 */
public static function nameHasPendingRequest( $newname ) {
-   $dbw = self::getDB( DB_SLAVE );
+   $dbw = self::getDB( DB_REPLICA );
$res = $dbw->selectField(
'renameuser_queue',
'rq_id',
diff --git a/includes/GlobalRename/GlobalRenameUserStatus.php 
b/includes/GlobalRename/GlobalRenameUserStatus.php
index fc8ec42..13d953a 100644
--- a/includes/GlobalRename/GlobalRenameUserStatus.php
+++ b/includes/GlobalRename/GlobalRenameUserStatus.php
@@ -28,11 +28,11 @@
/**
 * Get a DatabaseBase object for the CentralAuth db
 *
-* @param int $type DB_SLAVE or DB_MASTER
+* @param int $type DB_REPLICA or DB_MASTER
 *
 * @return DatabaseBase
 */
-   protected function getDB( $type = DB_SLAVE ) {
+   protected function getDB( $type = DB_REPLICA ) {
if ( $type === DB_MASTER ) {
return CentralAuthUtils::getCentralDB();
} else {
@@ -67,7 +67,7 @@
 * @return array (oldname, newname)
 */
public function getNames( $wiki = null, $useMaster = null ) {
-   $db = $this->getDB( $useMaster === 'master' ? DB_MASTER : 
DB_SLAVE );
+   $db = $this->getDB( $useMaster === 'master' ? DB_MASTER : 
DB_REPLICA );
 
$where = array( $this->getNameWhereClause( $db ) );
 
diff --git a/includes/LocalR

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: use DB_REPLICA instead of deprecated DB_SLAVE

2016-09-19 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311391

Change subject: use DB_REPLICA instead of deprecated DB_SLAVE
..

use DB_REPLICA instead of deprecated DB_SLAVE

Change-Id: I16ae082aeba0a5f40e913fec5e81157558954ab0
---
M includes/CentralAuthUser.php
M includes/CentralAuthUtils.php
M includes/GlobalRename/GlobalRenameRequest.php
M includes/GlobalRename/GlobalRenameUserStatus.php
M includes/LocalRenameJob/LocalRenameUserJob.php
M includes/specials/SpecialGlobalRenameQueue.php
M includes/specials/SpecialUsersWhoWillBeRenamed.php
M maintenance/checkLocalNames.php
M maintenance/checkLocalUser.php
M maintenance/fixStuckGlobalRename.php
M maintenance/migratePass0.php
M maintenance/migrateStewards.php
M maintenance/populateGlobalRenameLogSearch.php
13 files changed, 20 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/91/311391/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 0f543ae..52b0426 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2080,7 +2080,7 @@
function importLocalNames() {
$rows = [];
foreach ( self::getWikiList() as $wikiID ) {
-   $dbr = wfGetLB( $wikiID )->getConnectionRef( DB_SLAVE, 
array(), $wikiID );
+   $dbr = wfGetLB( $wikiID )->getConnectionRef( 
DB_REPLICA, array(), $wikiID );
$id = $dbr->selectField(
"`$wikiID`.`user`",
'user_id',
@@ -2334,7 +2334,7 @@
 */
protected function localUserData( $wikiID ) {
$lb = wfGetLB( $wikiID );
-   $db = $lb->getConnection( DB_SLAVE, array(), $wikiID );
+   $db = $lb->getConnection( DB_REPLICA, array(), $wikiID );
$fields = array(
'user_id',
'user_email',
diff --git a/includes/CentralAuthUtils.php b/includes/CentralAuthUtils.php
index 48b31a6..7ca4b49 100644
--- a/includes/CentralAuthUtils.php
+++ b/includes/CentralAuthUtils.php
@@ -62,7 +62,7 @@
global $wgCentralAuthDatabase;
 
return wfGetLB( $wgCentralAuthDatabase )->getConnection(
-   DB_SLAVE, 'centralauth', $wgCentralAuthDatabase );
+   DB_REPLICA, 'centralauth', $wgCentralAuthDatabase );
}
 
/**
diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index e096984..155dea4 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -321,7 +321,7 @@
 * @return stdClass|bool Row as object or false if not found
 */
protected static function fetchRowFromDB( array $where ) {
-   return self::getDB( DB_SLAVE )->selectRow(
+   return self::getDB( DB_REPLICA )->selectRow(
'renameuser_queue',
array(
'id'=> 'rq_id',
@@ -368,7 +368,7 @@
/**
 * Get a DatabaseBase object for the CentralAuth db
 *
-* @param int $type DB_SLAVE or DB_MASTER
+* @param int $type DB_REPLICA or DB_MASTER
 * @return DatabaseBase
 */
protected static function getDB( $type ) {
@@ -386,7 +386,7 @@
 * @return bool
 */
public static function nameHasPendingRequest( $newname ) {
-   $dbw = self::getDB( DB_SLAVE );
+   $dbw = self::getDB( DB_REPLICA );
$res = $dbw->selectField(
'renameuser_queue',
'rq_id',
diff --git a/includes/GlobalRename/GlobalRenameUserStatus.php 
b/includes/GlobalRename/GlobalRenameUserStatus.php
index fc8ec42..13d953a 100644
--- a/includes/GlobalRename/GlobalRenameUserStatus.php
+++ b/includes/GlobalRename/GlobalRenameUserStatus.php
@@ -28,11 +28,11 @@
/**
 * Get a DatabaseBase object for the CentralAuth db
 *
-* @param int $type DB_SLAVE or DB_MASTER
+* @param int $type DB_REPLICA or DB_MASTER
 *
 * @return DatabaseBase
 */
-   protected function getDB( $type = DB_SLAVE ) {
+   protected function getDB( $type = DB_REPLICA ) {
if ( $type === DB_MASTER ) {
return CentralAuthUtils::getCentralDB();
} else {
@@ -67,7 +67,7 @@
 * @return array (oldname, newname)
 */
public function getNames( $wiki = null, $useMaster = null ) {
-   $db = $this->getDB( $useMaster === 'master' ? DB_MASTER : 
DB_SLAVE );
+   $db = $this->getDB( $useMaster === 'master' ? DB_MASTER : 
DB_REPLICA );
 
$where = array( $this