X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FgetReplicaServer.php;h=554e373e8bdcabaa71c3cf701c313043fbe65cb6;hb=ae031e237eab8e2023d0fe128f9749a8a43ea439;hp=43e876ea071119cb02633aeb07bc58a535ca3210;hpb=5c28dd51ebfe07232b9d082812b64445dcc5f207;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/getReplicaServer.php b/maintenance/getReplicaServer.php index 43e876ea07..554e373e8b 100644 --- a/maintenance/getReplicaServer.php +++ b/maintenance/getReplicaServer.php @@ -23,12 +23,14 @@ require_once __DIR__ . '/Maintenance.php'; +use MediaWiki\MediaWikiServices; + /** * Maintenance script that reports the hostname of a replica DB server. * * @ingroup Maintenance */ -class GetSlaveServer extends Maintenance { +class GetReplicaServer extends Maintenance { public function __construct() { parent::__construct(); $this->addOption( "group", "Query group to check specifically" ); @@ -43,7 +45,7 @@ class GetSlaveServer extends Maintenance { $db = $this->getDB( DB_REPLICA, $this->getOption( 'group' ) ); $host = $db->getServer(); } else { - $lb = wfGetLB(); + $lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); $i = $lb->getReaderIndex(); $host = $lb->getServerName( $i ); } @@ -51,5 +53,5 @@ class GetSlaveServer extends Maintenance { } } -$maintClass = GetSlaveServer::class; +$maintClass = GetReplicaServer::class; require_once RUN_MAINTENANCE_IF_MAIN;