X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdoMaintenance.php;h=1f1a4c721b638513fd4f8b6c896b45774c89945a;hb=c5ffaf22539f0c5e422831332081c03ae92ca304;hp=2ac756cbe886536b9b4d64e1cb5a836ee7a84c62;hpb=78418f5728259c024ac3b2016e1edd0ab794c9c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index 2ac756cbe8..1f1a4c721b 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -34,7 +34,7 @@ if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) { // Wasn't included from the file scope, halt execution (probably wanted the class) // If a class is using commandLine.inc (old school maintenance), they definitely // cannot be included and will proceed with execution -if ( !Maintenance::shouldExecute() && $maintClass != 'CommandLineInc' ) { +if ( !Maintenance::shouldExecute() && $maintClass != CommandLineInc::class ) { return; } @@ -62,14 +62,14 @@ if ( !defined( 'MW_CONFIG_CALLBACK' ) && !defined( 'MW_CONFIG_FILE' ) ) { // Custom setup for Maintenance entry point if ( !defined( 'MW_SETUP_CALLBACK' ) ) { function wfMaintenanceSetup() { - // @codingStandardsIgnoreLine MediaWiki.NamingConventions.ValidGlobalName.wgPrefix + // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix global $maintenance, $wgLocalisationCacheConf, $wgCacheDirectory; if ( $maintenance->getDbType() === Maintenance::DB_NONE ) { if ( $wgLocalisationCacheConf['storeClass'] === false && ( $wgLocalisationCacheConf['store'] == 'db' || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) ) ) { - $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; + $wgLocalisationCacheConf['storeClass'] = LCStoreNull::class; } } @@ -91,7 +91,7 @@ $maintenance->checkRequiredExtensions(); $maintenance->setAgentAndTriggers(); // Do the work -$maintenance->execute(); +$success = $maintenance->execute(); // Potentially debug globals $maintenance->globals(); @@ -111,3 +111,8 @@ if ( isset( $lbFactory ) ) { $lbFactory->commitMasterChanges( 'doMaintenance' ); $lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT ); } + +// Exit with an error status if execute() returned false +if ( $success === false ) { + exit( 1 ); +}