Merge "Make database classes handle hyphens in $wgDBname"
[lhc/web/wiklou.git] / includes / db / loadbalancer / LBFactoryMulti.php
index d486e13..95bc8f4 100644 (file)
@@ -83,7 +83,7 @@
  *
  * @ingroup Database
  */
-class LBFactoryMulti extends LBFactory {
+class LBFactoryMulti extends LBFactoryMW {
        /** @var array A map of database names to section names */
        private $sectionsByDB;
 
@@ -164,7 +164,7 @@ class LBFactoryMulti extends LBFactory {
 
        /**
         * @param array $conf
-        * @throws MWException
+        * @throws InvalidArgumentException
         */
        public function __construct( array $conf ) {
                parent::__construct( $conf );
@@ -178,7 +178,7 @@ class LBFactoryMulti extends LBFactory {
 
                foreach ( $required as $key ) {
                        if ( !isset( $conf[$key] ) ) {
-                               throw new MWException( __CLASS__ . ": $key is required in configuration" );
+                               throw new InvalidArgumentException( __CLASS__ . ": $key is required in configuration" );
                        }
                        $this->$key = $conf[$key];
                }
@@ -264,12 +264,12 @@ class LBFactoryMulti extends LBFactory {
        /**
         * @param string $cluster
         * @param bool|string $wiki
-        * @throws MWException
+        * @throws InvalidArgumentException
         * @return LoadBalancer
         */
        protected function newExternalLB( $cluster, $wiki = false ) {
                if ( !isset( $this->externalLoads[$cluster] ) ) {
-                       throw new MWException( __METHOD__ . ": Unknown cluster \"$cluster\"" );
+                       throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"" );
                }
                $template = $this->serverTemplate;
                if ( isset( $this->externalTemplateOverrides ) ) {