00001 <?php 00009 require_once( dirname(__FILE__).'/commandLine.inc' ); 00010 00011 if ( $wgAllDBsAreLocalhost ) { 00012 # Can't fool the backup script 00013 print "localhost\n"; 00014 exit; 00015 } 00016 00017 if( isset( $options['group'] ) ) { 00018 $db = wfGetDB( DB_SLAVE, $options['group'] ); 00019 $host = $db->getServer(); 00020 } else { 00021 $lb = wfGetLB(); 00022 $i = $lb->getReaderIndex(); 00023 $host = $lb->getServerName( $i ); 00024 } 00025 00026 print "$host\n"; 00027 00028