From: Aaron Schulz Date: Fri, 23 Sep 2016 03:42:38 +0000 (-0700) Subject: Minor installer/upgrader cleanups X-Git-Tag: 1.31.0-rc.0~5320^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=9e8f157ed258060e9762fbaa5195f4c8417bf536;p=lhc%2Fweb%2Fwiklou.git Minor installer/upgrader cleanups Change-Id: I6352d16dce242c94203bdf7d020f1c0279fec6e5 --- diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 4f10367e6a..2b84144a3f 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -167,7 +167,7 @@ abstract class DatabaseInstaller { * * @param string $sourceFileMethod * @param string $stepName - * @param string $archiveTableMustNotExist + * @param bool $archiveTableMustNotExist * @return Status */ private function stepApplySourceFile( @@ -353,10 +353,14 @@ abstract class DatabaseInstaller { $up = DatabaseUpdater::newForDB( $this->db ); try { $up->doUpdates(); - } catch ( Exception $e ) { + } catch ( MWException $e ) { echo "\nAn error occurred:\n"; echo $e->getText(); $ret = false; + } catch ( Exception $e ) { + echo "\nAn error occurred:\n"; + echo $e->getMessage(); + $ret = false; } $up->purgeCache(); ob_end_flush(); diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 0d0da080fa..2425005ff8 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -20,6 +20,7 @@ * @file * @ingroup Deployment */ +use MediaWiki\MediaWikiServices; require_once __DIR__ . '/../../maintenance/Maintenance.php'; @@ -456,6 +457,8 @@ abstract class DatabaseUpdater { * @param bool $passSelf Whether to pass this object we calling external functions */ private function runUpdates( array $updates, $passSelf ) { + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $updatesDone = []; $updatesSkipped = []; foreach ( $updates as $params ) { @@ -470,7 +473,7 @@ abstract class DatabaseUpdater { flush(); if ( $ret !== false ) { $updatesDone[] = $origParams; - wfGetLBFactory()->waitForReplication(); + $lbFactory->waitForReplication(); } else { $updatesSkipped[] = [ $func, $params, $origParams ]; }