mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Replace deprecated wfGetLBFactory() and wfGetLB() call
Change-Id: I500196084db57e9d74dc25a513cbebea9ae3c9a6
This commit is contained in:
parent
6e3efee722
commit
9b0a6f7a47
|
@ -107,11 +107,17 @@ class MWEchoDbFactory {
|
||||||
public static function getDB( $db, $groups = [], $wiki = false ) {
|
public static function getDB( $db, $groups = [], $wiki = false ) {
|
||||||
global $wgEchoCluster;
|
global $wgEchoCluster;
|
||||||
|
|
||||||
|
$services = MediaWikiServices::getInstance();
|
||||||
|
|
||||||
// Use the external db defined for Echo
|
// Use the external db defined for Echo
|
||||||
if ( $wgEchoCluster ) {
|
if ( $wgEchoCluster ) {
|
||||||
$lb = wfGetLBFactory()->getExternalLB( $wgEchoCluster, $wiki );
|
$lb = $services->getDBLoadBalancerFactory()->getExternalLB( $wgEchoCluster, $wiki );
|
||||||
} else {
|
} else {
|
||||||
$lb = wfGetLB( $wiki );
|
if ( $wiki === false ) {
|
||||||
|
$lb = $services->getDBLoadBalancer();
|
||||||
|
} else {
|
||||||
|
$lb = $services->getDBLoadBalancerFactory()->getMainLB( $wiki );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $lb->getConnection( $db, $groups, $wiki );
|
return $lb->getConnection( $db, $groups, $wiki );
|
||||||
|
|
Loading…
Reference in a new issue