// Figure out which server to use
$replicaDB = $this->getOption( 'replicadb', $this->getOption( 'slave', '' ) );
if ( $replicaDB === 'any' ) {
- $index = DB_SLAVE;
+ $index = DB_REPLICA;
} elseif ( $replicaDB != '' ) {
$index = null;
$serverCount = $lb->getServerCount();
}
// Get a DB handle (with this wiki's DB selected) from the appropriate load balancer
$db = $lb->getConnection( $index, [], $wiki );
- if ( $this->hasOption( 'slave' ) && $db->getLBInfo( 'master' ) !== null ) {
+ if ( $replicaDB != '' && $db->getLBInfo( 'master' ) !== null ) {
$this->error( "The server selected ({$db->getServer()}) is not a replica DB.", 1 );
}