skins: Remove 'usemsgcache' and deprecate getDynamicStylesheetQuery
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index ad75c6b..1f1a4c7 100644 (file)
@@ -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;
 }
 
@@ -69,7 +69,7 @@ if ( !defined( 'MW_SETUP_CALLBACK' ) ) {
                                && ( $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 );
+}