Merge "includes/specials: Replace implicit Bugzilla bug numbers with Phab ones"
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / LBFactorySingle.php
index e116888..5931d80 100644 (file)
  * @ingroup Database
  */
 
+namespace Wikimedia\Rdbms;
+
+use IDatabase;
+use InvalidArgumentException;
+use BadMethodCallException;
+
 /**
  * An LBFactory class that always returns a single database object.
  */
@@ -70,20 +76,26 @@ class LBFactorySingle extends LBFactory {
                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 name (unused)
-        * @return LoadBalancerSingle
+        * @return LoadBalancerSingle[] Map of (cluster name => LoadBalancer)
         */
-       public function newExternalLB( $cluster ) {
-               return $this->lb;
+       public function getAllMainLBs() {
+               return [ 'DEFAULT' => $this->lb ];
        }
 
        /**
-        * @param string $cluster External storage cluster name (unused)
-        * @return LoadBalancerSingle
+        * @return LoadBalancerSingle[] Map of (cluster name => LoadBalancer)
         */
-       public function getExternalLB( $cluster ) {
-               return $this->lb;
+       public function getAllExternalLBs() {
+               return [];
        }
 
        /**