Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / LBFactorySingle.php
index af4a350..819375d 100644 (file)
@@ -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 [];
        }
 
        /**