X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FgetSlaveServer.php;h=2fa2d7f6ea65b0fff27d7c3b6111bb2b96bced40;hp=81228cc575ba393b7093bb4b5796f6da0b4dc38f;hb=12601ff7d2796752404bfb331fccc41083d31f9f;hpb=4b069cd1b88877fbb253af8780e358d96ba2587c diff --git a/maintenance/getSlaveServer.php b/maintenance/getSlaveServer.php index 81228cc575..2fa2d7f6ea 100644 --- a/maintenance/getSlaveServer.php +++ b/maintenance/getSlaveServer.php @@ -1,55 +1,3 @@ addOption( "group", "Query group to check specifically" ); - $this->addDescription( 'Report the hostname of a slave server' ); - } - - public function execute() { - global $wgAllDBsAreLocalhost; - if ( $wgAllDBsAreLocalhost ) { - $host = 'localhost'; - } elseif ( $this->hasOption( 'group' ) ) { - $db = $this->getDB( DB_SLAVE, $this->getOption( 'group' ) ); - $host = $db->getServer(); - } else { - $lb = wfGetLB(); - $i = $lb->getReaderIndex(); - $host = $lb->getServerName( $i ); - } - $this->output( "$host\n" ); - } -} - -$maintClass = "GetSlaveServer"; -require_once RUN_MAINTENANCE_IF_MAIN; +// B/C alias +require_once __DIR__ . '/getReplicaServer.php';