X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Flbfactory%2FLBFactorySingle.php;h=819375d797d603d291875bb37cca22c59e4c2c4f;hb=9964ca1a390c446397dcd466916ffed356cdc3c9;hp=af4a35003576a4f4ee5df3cc15b1bf9dbbf1470f;hpb=75d8b6c6cd2b70d98242e1246678c12e973a5dfa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/lbfactory/LBFactorySingle.php b/includes/libs/rdbms/lbfactory/LBFactorySingle.php index af4a350035..819375d797 100644 --- a/includes/libs/rdbms/lbfactory/LBFactorySingle.php +++ b/includes/libs/rdbms/lbfactory/LBFactorySingle.php @@ -39,7 +39,9 @@ class LBFactorySingle extends LBFactory { throw new InvalidArgumentException( "Missing 'connection' argument." ); } - $this->lb = new LoadBalancerSingle( array_merge( $this->baseLoadBalancerParams(), $conf ) ); + $lb = new LoadBalancerSingle( array_merge( $this->baseLoadBalancerParams(), $conf ) ); + $this->initLoadBalancer( $lb ); + $this->lb = $lb; } /** @@ -53,37 +55,41 @@ class LBFactorySingle extends LBFactory { } /** - * @param bool|string $wiki + * @param bool|string $domain (unused) * @return LoadBalancerSingle */ - public function newMainLB( $wiki = false ) { + public function newMainLB( $domain = false ) { return $this->lb; } /** - * @param bool|string $wiki + * @param bool|string $domain (unused) * @return LoadBalancerSingle */ - public function getMainLB( $wiki = false ) { + public function getMainLB( $domain = false ) { return $this->lb; } + public function newExternalLB( $cluster ) { + throw new BadMethodCallException( "Method is not supported." ); + } + + public function getExternalLB( $cluster ) { + throw new BadMethodCallException( "Method is not supported." ); + } + /** - * @param string $cluster External storage cluster, or false for core - * @param bool|string $wiki Wiki ID, or false for the current wiki - * @return LoadBalancerSingle + * @return LoadBalancerSingle[] Map of (cluster name => LoadBalancer) */ - public function newExternalLB( $cluster, $wiki = false ) { - return $this->lb; + public function getAllMainLBs() { + return [ 'DEFAULT' => $this->lb ]; } /** - * @param string $cluster External storage cluster, or false for core - * @param bool|string $wiki Wiki ID, or false for the current wiki - * @return LoadBalancerSingle + * @return LoadBalancerSingle[] Map of (cluster name => LoadBalancer) */ - public function getExternalLB( $cluster, $wiki = false ) { - return $this->lb; + public function getAllExternalLBs() { + return []; } /**