X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdoMaintenance.php;h=0ee1e6a0b8b4320ffa999c3a45b3924535b2b5dc;hb=644c853ffbf20ccba8ea8aa9772ef97df32bb94a;hp=1f1a4c721b638513fd4f8b6c896b45774c89945a;hpb=aef5149bcd5cdf7f11ce73cc32a42be0e426e1b4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index 1f1a4c721b..0ee1e6a0b8 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -61,6 +61,7 @@ if ( !defined( 'MW_CONFIG_CALLBACK' ) && !defined( 'MW_CONFIG_FILE' ) ) { // Custom setup for Maintenance entry point if ( !defined( 'MW_SETUP_CALLBACK' ) ) { + function wfMaintenanceSetup() { // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix global $maintenance, $wgLocalisationCacheConf, $wgCacheDirectory; @@ -75,6 +76,7 @@ if ( !defined( 'MW_SETUP_CALLBACK' ) ) { $maintenance->finalSetup(); } + define( 'MW_SETUP_CALLBACK', 'wfMaintenanceSetup' ); } @@ -90,8 +92,20 @@ $maintenance->checkRequiredExtensions(); // This avoids having long running scripts just OOM and lose all the updates. $maintenance->setAgentAndTriggers(); +$maintenance->validateParamsAndArgs(); + // Do the work -$success = $maintenance->execute(); +try { + $success = $maintenance->execute(); +} catch ( Exception $ex ) { + $success = false; + while ( $ex ) { + $cls = get_class( $ex ); + print "$cls from line {$ex->getLine()} of {$ex->getFile()}: {$ex->getMessage()}\n"; + print $ex->getTraceAsString() . "\n"; + $ex = $ex->getPrevious(); + } +} // Potentially debug globals $maintenance->globals();