Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / LBFactorySimple.php
index 1e69d8f..15cd508 100644 (file)
  * @ingroup Database
  */
 
+namespace Wikimedia\Rdbms;
+
+use InvalidArgumentException;
+
 /**
  * A simple single-master LBFactory that gets its configuration from the b/c globals
  */
@@ -108,6 +112,19 @@ class LBFactorySimple extends LBFactory {
                return $this->extLBs[$cluster];
        }
 
+       public function getAllMainLBs() {
+               return [ 'DEFAULT' => $this->getMainLB() ];
+       }
+
+       public function getAllExternalLBs() {
+               $lbs = [];
+               foreach ( $this->externalClusters as $cluster => $unused ) {
+                       $lbs[$cluster] = $this->getExternalLB( $cluster );
+               }
+
+               return $lbs;
+       }
+
        private function newLoadBalancer( array $servers ) {
                $lb = new LoadBalancer( array_merge(
                        $this->baseLoadBalancerParams(),