Merge "Fix unused vars/pointless assignments"
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index f3fb32c..1c53fe8 100644 (file)
@@ -90,8 +90,10 @@ $maintenance->checkRequiredExtensions();
 // This avoids having long running scripts just OOM and lose all the updates.
 $maintenance->setAgentAndTriggers();
 
+$maintenance->validateParamsAndArgs();
+
 // Do the work
-$maintenance->execute();
+$success = $maintenance->execute();
 
 // Potentially debug globals
 $maintenance->globals();
@@ -111,3 +113,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 );
+}