Allow reset of global services.
[lhc/web/wiklou.git] / maintenance / getSlaveServer.php
index 0270052..81228cc 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that reports the hostname of a slave server.
@@ -32,14 +32,15 @@ class GetSlaveServer extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->addOption( "group", "Query group to check specifically" );
-               $this->mDescription = "Report the hostname of a slave server";
+               $this->addDescription( 'Report the hostname of a slave server' );
        }
+
        public function execute() {
                global $wgAllDBsAreLocalhost;
                if ( $wgAllDBsAreLocalhost ) {
                        $host = 'localhost';
                } elseif ( $this->hasOption( 'group' ) ) {
-                       $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
+                       $db = $this->getDB( DB_SLAVE, $this->getOption( 'group' ) );
                        $host = $db->getServer();
                } else {
                        $lb = wfGetLB();
@@ -51,4 +52,4 @@ class GetSlaveServer extends Maintenance {
 }
 
 $maintClass = "GetSlaveServer";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;