dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix HeaderCallback failing on headers without a colon"
[lhc/web/wiklou.git]
/
maintenance
/
getReplicaServer.php
diff --git
a/maintenance/getReplicaServer.php
b/maintenance/getReplicaServer.php
index
43e876e
..
554e373
100644
(file)
--- a/
maintenance/getReplicaServer.php
+++ b/
maintenance/getReplicaServer.php
@@
-23,12
+23,14
@@
require_once __DIR__ . '/Maintenance.php';
require_once __DIR__ . '/Maintenance.php';
+use MediaWiki\MediaWikiServices;
+
/**
* Maintenance script that reports the hostname of a replica DB server.
*
* @ingroup Maintenance
*/
/**
* Maintenance script that reports the hostname of a replica DB server.
*
* @ingroup Maintenance
*/
-class Get
Slave
Server extends Maintenance {
+class Get
Replica
Server extends Maintenance {
public function __construct() {
parent::__construct();
$this->addOption( "group", "Query group to check specifically" );
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 {
$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 );
}
$i = $lb->getReaderIndex();
$host = $lb->getServerName( $i );
}
@@
-51,5
+53,5
@@
class GetSlaveServer extends Maintenance {
}
}
}
}
-$maintClass = Get
Slave
Server::class;
+$maintClass = Get
Replica
Server::class;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;