Special-case debugging hack
[lhc/web/wiklou.git] / maintenance / getSlaveServer.php
1 <?php
2 /**
3 * @file
4 * @ingroup Maintenance
5 */
6
7 require_once( dirname(__FILE__).'/commandLine.inc' );
8
9 if ( $wgAllDBsAreLocalhost ) {
10 # Can't fool the backup script
11 print "localhost\n";
12 exit;
13 }
14
15 if( isset( $options['group'] ) ) {
16 $db = wfGetDB( DB_SLAVE, $options['group'] );
17 $host = $db->getServer();
18 } else {
19 $lb = wfGetLB();
20 $i = $lb->getReaderIndex();
21 $host = $lb->getServerName( $i );
22 }
23
24 print "$host\n";
25
26