Huji has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374807 )

Change subject: Replace DB_SLAVE with DB_REPLICA
......................................................................

Replace DB_SLAVE with DB_REPLICA

Change-Id: I5296eee60dcc30bf4a16342b21d0970ff203d23d
---
M cli/makeSimpleList.php
M cli/purgePrivateVoteData.php
M cli/voterList.php
M cli/wm-scripts/bv2013/buildSpamTranslations.php
M cli/wm-scripts/bv2013/doSpam.php
M cli/wm-scripts/bv2013/populateEditCount.php
M cli/wm-scripts/bv2013/voterList.php
M cli/wm-scripts/bv2015/doSpam.php
M cli/wm-scripts/bv2015/populateEditCount-fixup.php
M cli/wm-scripts/bv2015/populateEditCount.php
M cli/wm-scripts/bv2015/voterList.php
M cli/wm-scripts/bv2017/doSpam.php
M cli/wm-scripts/bv2017/populateEditCount.php
M cli/wm-scripts/bv2017/voterList.php
M cli/wm-scripts/dumpGlobalVoterList.php
M includes/jobs/PopulateVoterListJob.php
M includes/main/Store.php
M includes/pages/VoterEligibilityPage.php
18 files changed, 24 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/07/374807/1

diff --git a/cli/makeSimpleList.php b/cli/makeSimpleList.php
index ecc8b60..30092f2 100644
--- a/cli/makeSimpleList.php
+++ b/cli/makeSimpleList.php
@@ -16,7 +16,7 @@
 $optionsWithArgs = [ 'before', 'edits', 'start-from' ];
 require __DIR__ . '/cli.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 $fname = 'makeSimpleList.php';
 $before = isset( $options['before'] ) ? $dbr->timestamp( strtotime( 
$options['before'] ) ) : false;
diff --git a/cli/purgePrivateVoteData.php b/cli/purgePrivateVoteData.php
index 1db436c..f3f52b0 100644
--- a/cli/purgePrivateVoteData.php
+++ b/cli/purgePrivateVoteData.php
@@ -50,7 +50,7 @@
 
                $electionsToPurge = [];
                $deleteSets = [];
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
                if ( !$dbr->tableExists( 'securepoll_elections' ) ) {
                        $this->output( "`securepoll_elections` table does not 
exist. Nothing to do.\n" );
diff --git a/cli/voterList.php b/cli/voterList.php
index cfc2d9b..d8937b8 100644
--- a/cli/voterList.php
+++ b/cli/voterList.php
@@ -10,7 +10,7 @@
 $optionsWithArgs = [ 'before', 'edits' ];
 require $IP . '/maintenance/commandLine.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 $fname = 'voterList.php';
 $maxUser = $dbr->selectField( 'user', 'MAX(user_id)', false );
diff --git a/cli/wm-scripts/bv2013/buildSpamTranslations.php 
b/cli/wm-scripts/bv2013/buildSpamTranslations.php
index 1162534..18262bb 100644
--- a/cli/wm-scripts/bv2013/buildSpamTranslations.php
+++ b/cli/wm-scripts/bv2013/buildSpamTranslations.php
@@ -8,7 +8,7 @@
 
 $wgDebugLogFile = '/dev/stderr';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbr->setFlag( DBO_DEBUG );
 
 $prefix = "Wikimedia_Foundation_elections_2013/Voter_e-mail/";
diff --git a/cli/wm-scripts/bv2013/doSpam.php b/cli/wm-scripts/bv2013/doSpam.php
index bf11c59..0d95134 100644
--- a/cli/wm-scripts/bv2013/doSpam.php
+++ b/cli/wm-scripts/bv2013/doSpam.php
@@ -31,7 +31,7 @@
 $election_id = 290;
 
 $voted = [];
-$vdb = wfGetDB( DB_SLAVE, [], 'votewiki' );
+$vdb = wfGetDB( DB_REPLICA, [], 'votewiki' );
 $res = $vdb->select(
        [ 'securepoll_votes', 'securepoll_voters' ],
        [ 'voter_name', 'voter_properties' ],
@@ -64,7 +64,7 @@
 
        $defaultLang = $wgConf->get( 'wgLanguageCode', $w, null, [ 'lang' => 
$siteLang ], $tags );
 
-       $db = wfGetDB( DB_SLAVE, null, $w );
+       $db = wfGetDB( DB_REPLICA, null, $w );
 
        try {
                $res = $db->select(
@@ -193,7 +193,7 @@
  */
 function runChecks( $wiki, $usersToCheck /* user ID */ ) {
        global $users;
-       $dbr = wfGetDB( DB_SLAVE, null, $wiki );
+       $dbr = wfGetDB( DB_REPLICA, null, $wiki );
 
        $res = $dbr->select( 'ipblocks', 'ipb_user',
                [
diff --git a/cli/wm-scripts/bv2013/populateEditCount.php 
b/cli/wm-scripts/bv2013/populateEditCount.php
index 0daa0a6..aee98cc 100644
--- a/cli/wm-scripts/bv2013/populateEditCount.php
+++ b/cli/wm-scripts/bv2013/populateEditCount.php
@@ -8,7 +8,7 @@
 
 require __DIR__ . '/../../cli.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 
 $maxUser = $dbr->selectField( 'user', 'MAX(user_id)', false );
diff --git a/cli/wm-scripts/bv2013/voterList.php 
b/cli/wm-scripts/bv2013/voterList.php
index 184e7fd..c62c4f4 100644
--- a/cli/wm-scripts/bv2013/voterList.php
+++ b/cli/wm-scripts/bv2013/voterList.php
@@ -1,7 +1,7 @@
 <?php
 
 require __DIR__ . '/../../cli.inc';
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 $fname = 'voterList.php';
 $listName = 'board-vote-2013';
@@ -50,7 +50,7 @@
  */
 function spGetQualifiedUsers( $users ) {
        global $wgCentralAuthDatabase, $wgLocalDatabases;
-       $dbc = wfGetDB( DB_SLAVE, [], $wgCentralAuthDatabase );
+       $dbc = wfGetDB( DB_REPLICA, [], $wgCentralAuthDatabase );
        $editCounts = [];
 
        # Check local attachment
@@ -67,7 +67,7 @@
        }
        $nonLocalUsers = [];
 
-       $localEditCounts = spGetEditCounts( wfGetDB( DB_SLAVE ), $users );
+       $localEditCounts = spGetEditCounts( wfGetDB( DB_REPLICA ), $users );
        foreach ( $localEditCounts as $user => $counts ) {
                if ( $counts[0] == 0 ) {
                        // No recent local edits, remove from consideration
@@ -97,7 +97,7 @@
                                continue;
                        }
                        $lb = wfGetLB( $wiki );
-                       $db = $lb->getConnection( DB_SLAVE, [], $wiki );
+                       $db = $lb->getConnection( DB_REPLICA, [], $wiki );
                        $foreignEditCounts = spGetEditCounts( $db, $wikiUsers );
                        $lb->reuseConnection( $db );
                        foreach ( $foreignEditCounts as $name => $count ) {
diff --git a/cli/wm-scripts/bv2015/doSpam.php b/cli/wm-scripts/bv2015/doSpam.php
index aa2d188..5283407 100644
--- a/cli/wm-scripts/bv2015/doSpam.php
+++ b/cli/wm-scripts/bv2015/doSpam.php
@@ -66,7 +66,7 @@
 }
 
 $voted = [];
-$vdb = wfGetDB( DB_SLAVE, [], 'votewiki' );
+$vdb = wfGetDB( DB_REPLICA, [], 'votewiki' );
 $voted = $vdb->selectFieldValues( 'securepoll_voters', 'voter_name',
        [ 'voter_election' => $electionId ] );
 
diff --git a/cli/wm-scripts/bv2015/populateEditCount-fixup.php 
b/cli/wm-scripts/bv2015/populateEditCount-fixup.php
index 0b7d43d..46e779e 100644
--- a/cli/wm-scripts/bv2015/populateEditCount-fixup.php
+++ b/cli/wm-scripts/bv2015/populateEditCount-fixup.php
@@ -5,7 +5,7 @@
  */
 require __DIR__ . '/../../cli.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 
 $maxUser = $dbr->selectField( 'user', 'MAX(user_id)', false );
diff --git a/cli/wm-scripts/bv2015/populateEditCount.php 
b/cli/wm-scripts/bv2015/populateEditCount.php
index 98ea4cd..606e89e 100644
--- a/cli/wm-scripts/bv2015/populateEditCount.php
+++ b/cli/wm-scripts/bv2015/populateEditCount.php
@@ -8,7 +8,7 @@
 
 require __DIR__ . '/../../cli.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 
 $maxUser = $dbr->selectField( 'user', 'MAX(user_id)', false );
diff --git a/cli/wm-scripts/bv2015/voterList.php 
b/cli/wm-scripts/bv2015/voterList.php
index 9605a6c..08e9b29 100644
--- a/cli/wm-scripts/bv2015/voterList.php
+++ b/cli/wm-scripts/bv2015/voterList.php
@@ -72,7 +72,7 @@
                        continue;
                }
                $lb = wfGetLB( $wiki );
-               $db = $lb->getConnection( DB_SLAVE, [], $wiki );
+               $db = $lb->getConnection( DB_REPLICA, [], $wiki );
                $foreignEditCounts = spGetEditCounts( $db, $wikiUsers );
                $lb->reuseConnection( $db );
                foreach ( $foreignEditCounts as $name => $count ) {
diff --git a/cli/wm-scripts/bv2017/doSpam.php b/cli/wm-scripts/bv2017/doSpam.php
index aa2d188..5283407 100644
--- a/cli/wm-scripts/bv2017/doSpam.php
+++ b/cli/wm-scripts/bv2017/doSpam.php
@@ -66,7 +66,7 @@
 }
 
 $voted = [];
-$vdb = wfGetDB( DB_SLAVE, [], 'votewiki' );
+$vdb = wfGetDB( DB_REPLICA, [], 'votewiki' );
 $voted = $vdb->selectFieldValues( 'securepoll_voters', 'voter_name',
        [ 'voter_election' => $electionId ] );
 
diff --git a/cli/wm-scripts/bv2017/populateEditCount.php 
b/cli/wm-scripts/bv2017/populateEditCount.php
index 1e2c456..638b424 100644
--- a/cli/wm-scripts/bv2017/populateEditCount.php
+++ b/cli/wm-scripts/bv2017/populateEditCount.php
@@ -8,7 +8,7 @@
 
 require __DIR__ . '/../../cli.inc';
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $dbw = wfGetDB( DB_MASTER );
 
 $maxUser = $dbr->selectField( 'user', 'MAX(user_id)', false );
diff --git a/cli/wm-scripts/bv2017/voterList.php 
b/cli/wm-scripts/bv2017/voterList.php
index eeeb22b..26ce53b 100644
--- a/cli/wm-scripts/bv2017/voterList.php
+++ b/cli/wm-scripts/bv2017/voterList.php
@@ -72,7 +72,7 @@
                        continue;
                }
                $lb = wfGetLB( $wiki );
-               $db = $lb->getConnection( DB_SLAVE, [], $wiki );
+               $db = $lb->getConnection( DB_REPLICA, [], $wiki );
                $foreignEditCounts = spGetEditCounts( $db, $wikiUsers );
                $lb->reuseConnection( $db );
                foreach ( $foreignEditCounts as $name => $count ) {
diff --git a/cli/wm-scripts/dumpGlobalVoterList.php 
b/cli/wm-scripts/dumpGlobalVoterList.php
index 9999132..7c7be09 100644
--- a/cli/wm-scripts/dumpGlobalVoterList.php
+++ b/cli/wm-scripts/dumpGlobalVoterList.php
@@ -8,7 +8,7 @@
 
 foreach ( $wikis as $wikiId ) {
        $lb = wfGetLB( $wikiId );
-       $db = $lb->getConnection( DB_SLAVE, [], $wikiId );
+       $db = $lb->getConnection( DB_REPLICA, [], $wikiId );
 
        if ( !$db->tableExists( 'securepoll_lists' ) ) {
                $lb->reuseConnection( $db );
diff --git a/includes/jobs/PopulateVoterListJob.php 
b/includes/jobs/PopulateVoterListJob.php
index 6f17d35..66ec79d 100644
--- a/includes/jobs/PopulateVoterListJob.php
+++ b/includes/jobs/PopulateVoterListJob.php
@@ -87,7 +87,7 @@
                $maxIds = [];
                $total = 0;
                foreach ( $wikis as $wiki ) {
-                       $dbr = wfGetLB( $wiki )->getConnectionRef( DB_SLAVE, 
[], $wiki );
+                       $dbr = wfGetLB( $wiki )->getConnectionRef( DB_REPLICA, 
[], $wiki );
                        $max = $dbr->selectField( 'user', 'MAX(user_id)' );
                        if ( !$max ) {
                                $max = 0;
@@ -192,7 +192,7 @@
                                return true;
                        }
 
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
 
                        // Construct the list of user_ids in our range that 
pass the criteria
                        $users = null;
diff --git a/includes/main/Store.php b/includes/main/Store.php
index c71d625..4a6ef07 100644
--- a/includes/main/Store.php
+++ b/includes/main/Store.php
@@ -130,7 +130,7 @@
 
        function getElectionInfo( $ids ) {
                $ids = (array)$ids;
-               $db = $this->getDB( DB_SLAVE );
+               $db = $this->getDB( DB_REPLICA );
                $res = $db->select(
                        'securepoll_elections',
                        '*',
diff --git a/includes/pages/VoterEligibilityPage.php 
b/includes/pages/VoterEligibilityPage.php
index 3b6c0e7..bb485b5 100644
--- a/includes/pages/VoterEligibilityPage.php
+++ b/includes/pages/VoterEligibilityPage.php
@@ -160,7 +160,7 @@
                }
        }
 
-       private function fetchList( $property, $db = DB_SLAVE ) {
+       private function fetchList( $property, $db = DB_REPLICA ) {
                $wikis = $this->election->getProperty( 'wikis' );
                if ( $wikis ) {
                        $wikis = explode( "\n", $wikis );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5296eee60dcc30bf4a16342b21d0970ff203d23d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Huji <[email protected]>

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

Reply via email to