Merge "Revision: Assert that $mRecord is never null in Revision"
[lhc/web/wiklou.git] / includes / libs / rdbms / lbfactory / LBFactory.php
index d213dc9..9a6c224 100644 (file)
@@ -618,7 +618,15 @@ abstract class LBFactory implements ILBFactory {
                $this->indexAliases = $aliases;
        }
 
+       /**
+        * @param string $prefix
+        * @deprecated Since 1.33
+        */
        public function setDomainPrefix( $prefix ) {
+               $this->setLocalDomainPrefix( $prefix );
+       }
+
+       public function setLocalDomainPrefix( $prefix ) {
                $this->localDomain = new DatabaseDomain(
                        $this->localDomain->getDatabase(),
                        null,
@@ -626,7 +634,17 @@ abstract class LBFactory implements ILBFactory {
                );
 
                $this->forEachLB( function ( ILoadBalancer $lb ) use ( $prefix ) {
-                       $lb->setDomainPrefix( $prefix );
+                       $lb->setLocalDomainPrefix( $prefix );
+               } );
+       }
+
+       public function redefineLocalDomain( $domain ) {
+               $this->closeAll();
+
+               $this->localDomain = DatabaseDomain::newFromId( $domain );
+
+               $this->forEachLB( function ( ILoadBalancer $lb ) {
+                       $lb->redefineLocalDomain( $this->localDomain );
                } );
        }