Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / filerepo / ForeignDBViaLBRepo.php
index 55df1af..f83fd1c 100644 (file)
@@ -59,23 +59,22 @@ class ForeignDBViaLBRepo extends LocalRepo {
         * @return IDatabase
         */
        function getMasterDB() {
-               return wfGetDB( DB_MASTER, [], $this->wiki );
+               return wfGetLB( $this->wiki )->getConnectionRef( DB_MASTER, [], $this->wiki );
        }
 
        /**
         * @return IDatabase
         */
-       function getSlaveDB() {
-               return wfGetDB( DB_REPLICA, [], $this->wiki );
+       function getReplicaDB() {
+               return wfGetLB( $this->wiki )->getConnectionRef( DB_REPLICA, [], $this->wiki );
        }
 
        /**
         * @return Closure
         */
        protected function getDBFactory() {
-               $wiki = $this->wiki;
-               return function( $index ) use ( $wiki ) {
-                       return wfGetDB( $index, [], $wiki );
+               return function( $index ) {
+                       return wfGetLB( $this->wiki )->getConnectionRef( $index, [], $this->wiki );
                };
        }
 
@@ -101,7 +100,7 @@ class ForeignDBViaLBRepo extends LocalRepo {
        }
 
        protected function assertWritableRepo() {
-               throw new MWException( get_class( $this ) . ': write operations are not supported.' );
+               throw new MWException( static::class . ': write operations are not supported.' );
        }
 
        public function getInfo() {