// 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;
}
&& ( $wgLocalisationCacheConf['store'] == 'db'
|| ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) )
) {
- $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
+ $wgLocalisationCacheConf['storeClass'] = LCStoreNull::class;
}
}
$maintenance->setAgentAndTriggers();
// Do the work
-$maintenance->execute();
+$success = $maintenance->execute();
// Potentially debug globals
$maintenance->globals();
$lbFactory->commitMasterChanges( 'doMaintenance' );
$lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
}
+
+// Exit with an error status if execute() returned false
+if ( $success === false ) {
+ exit( 1 );
+}