Add --group parameter on getSlaveServer to select from a query group
This commit is contained in:
parent
2df92d9695
commit
6e644fecc6
1 changed files with 10 additions and 2 deletions
|
|
@ -1,7 +1,15 @@
|
|||
<?php
|
||||
|
||||
require_once( dirname(__FILE__).'/commandLine.inc' );
|
||||
$i = $wgLoadBalancer->getReaderIndex();
|
||||
print $wgDBservers[$i]['host'] . "\n";
|
||||
|
||||
if( isset( $options['group'] ) ) {
|
||||
$db = wfGetDB( DB_SLAVE, $options['group'] );
|
||||
$host = $db->getProperty( 'mServer' );
|
||||
} else {
|
||||
$i = $wgLoadBalancer->getReaderIndex();
|
||||
$host = $wgDBservers[$i]['host'];
|
||||
}
|
||||
|
||||
print "$host\n";
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue