From: Chad Horohoe Date: Tue, 23 Aug 2016 19:16:01 +0000 (-0700) Subject: CloneDatabase: Simplify callback structure X-Git-Tag: 1.31.0-rc.0~5926 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=dca7653437389d4820450075887cadc4b00046a9;p=lhc%2Fweb%2Fwiklou.git CloneDatabase: Simplify callback structure Change-Id: I4d5184fd7417e61e9a111bd414f8c62539229ef9 --- diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 3cd09e257f..577c98dc72 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -129,25 +129,11 @@ class CloneDatabase { */ public static function changePrefix( $prefix ) { global $wgDBprefix; - wfGetLBFactory()->forEachLB( [ 'CloneDatabase', 'changeLBPrefix' ], [ $prefix ] ); + wfGetLBFactory()->forEachLB( function( $lb ) use ( $prefix ) { + $lb->forEachOpenConnection( function ( $db ) use ( $prefix ) { + $db->tablePrefix( $prefix ); + } ); + } ); $wgDBprefix = $prefix; } - - /** - * @param LoadBalancer $lb - * @param string $prefix - * @return void - */ - public static function changeLBPrefix( $lb, $prefix ) { - $lb->forEachOpenConnection( [ 'CloneDatabase', 'changeDBPrefix' ], [ $prefix ] ); - } - - /** - * @param DatabaseBase $db - * @param string $prefix - * @return void - */ - public static function changeDBPrefix( $db, $prefix ) { - $db->tablePrefix( $prefix ); - } }