Renames preparatory to parser tests refactor
[lhc/web/wiklou.git] / maintenance / sql.php
index bf50f65..e6a30a3 100644 (file)
@@ -55,7 +55,7 @@ class MwSql extends Maintenance {
                // 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();
@@ -73,7 +73,7 @@ class MwSql extends Maintenance {
                }
                // 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 );
                }