From dca7653437389d4820450075887cadc4b00046a9 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 23 Aug 2016 12:16:01 -0700 Subject: [PATCH] CloneDatabase: Simplify callback structure Change-Id: I4d5184fd7417e61e9a111bd414f8c62539229ef9 --- includes/db/CloneDatabase.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) 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 ); - } } -- 2.20.1