*
* @param string $sourceFileMethod
* @param string $stepName
- * @param string $archiveTableMustNotExist
+ * @param bool $archiveTableMustNotExist
* @return Status
*/
private function stepApplySourceFile(
$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();
* @file
* @ingroup Deployment
*/
+use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
* @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 ) {
flush();
if ( $ret !== false ) {
$updatesDone[] = $origParams;
- wfGetLBFactory()->waitForReplication();
+ $lbFactory->waitForReplication();
} else {
$updatesSkipped[] = [ $func, $params, $origParams ];
}