*
* @ingroup Maintenance
*/
-
-require_once( dirname(__FILE__) . '/Maintenance.php' );
+
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class GetSlaveServer extends Maintenance {
public function __construct() {
}
public function execute() {
global $wgAllDBsAreLocalhost;
- if( $wgAllDBsAreLocalhost ) {
+ if ( $wgAllDBsAreLocalhost ) {
$host = 'localhost';
} else {
- if( $this->hasOption('group') ) {
- $db = wfGetDB( DB_SLAVE, $this->getOption('group') );
+ if ( $this->hasOption( 'group' ) ) {
+ $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
$host = $db->getServer();
} else {
$lb = wfGetLB();
}
$maintClass = "GetSlaveServer";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );