From: jenkins-bot Date: Wed, 21 Sep 2016 21:12:00 +0000 (+0000) Subject: Merge "Fix IDEA warnings in CloneDatabase" X-Git-Tag: 1.31.0-rc.0~5411 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=92d64387c4a4645635a5d1563aabebc7f43c83ac;hp=0c34f5fc1a7ebedb4307e1f54a70a5009d9115dc;p=lhc%2Fweb%2Fwiklou.git Merge "Fix IDEA warnings in CloneDatabase" --- diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 2af742e971..f1ccd2aebd 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -23,6 +23,7 @@ * @file * @ingroup Database */ +use MediaWiki\MediaWikiServices; class CloneDatabase { /** @var string Table prefix for cloning */ @@ -40,16 +41,19 @@ class CloneDatabase { /** @var bool Whether to use temporary tables or not */ private $useTemporaryTables = true; + /** @var Database */ + private $db; + /** * Constructor * - * @param IDatabase $db A database subclass + * @param Database $db A database subclass * @param array $tablesToClone An array of tables to clone, unprefixed * @param string $newTablePrefix Prefix to assign to the tables * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix * @param bool $dropCurrentTables */ - public function __construct( IDatabase $db, array $tablesToClone, + public function __construct( Database $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -130,7 +134,7 @@ class CloneDatabase { public static function changePrefix( $prefix ) { global $wgDBprefix; - $lbFactory = wfGetLBFactory(); + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $lbFactory->setDomainPrefix( $prefix ); $wgDBprefix = $prefix; }