diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index 7c4741a80..453be1dce 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -278,7 +278,7 @@ class MFCompiler * @return void * @throws Exception */ - public function Compile($sTargetDir, $oP = null, $bUseSymbolicLinks = null, $bSkipTempDir = false) + public function Compile($sTargetDir, $oP = null, $bUseSymbolicLinks = null, $bSkipTempDir = false, $bEnterMaintenanceMode = true) { if (is_null($bUseSymbolicLinks)) { $bUseSymbolicLinks = false; @@ -297,8 +297,7 @@ class MFCompiler } else { $oConfig = null; } - if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) { - + if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) { SetupUtils::EnterMaintenanceMode($oConfig); } if ($bUseSymbolicLinks || $bSkipTempDir) { @@ -321,7 +320,7 @@ class MFCompiler // Cleanup the temporary directory SetupUtils::rrmdir($sTempTargetDir); } - if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) { + if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) { SetupUtils::ExitMaintenanceMode(); } throw $e; @@ -331,7 +330,7 @@ class MFCompiler // Move the results to the target directory SetupUtils::movedir($sTempTargetDir, $sFinalTargetDir); } - if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) { + if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) { SetupUtils::ExitMaintenanceMode(); } diff --git a/setup/sequencers/ApplicationInstallSequencer.php b/setup/sequencers/ApplicationInstallSequencer.php index fa697403b..a2a49c68b 100644 --- a/setup/sequencers/ApplicationInstallSequencer.php +++ b/setup/sequencers/ApplicationInstallSequencer.php @@ -429,12 +429,12 @@ class ApplicationInstallSequencer extends StepSequencer * * @since 3.1.0 N°2013 added the aParamValues param */ - protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bUseSymbolicLinks = null) + protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bUseSymbolicLinks = null, $bEnterMaintenanceMode = true) { /** - * @since 3.2.0 move the ContextTag init at the very beginning of the method - * @noinspection PhpUnusedLocalVariableInspection - */ + * @since 3.2.0 move the ContextTag init at the very beginning of the method + * @noinspection PhpUnusedLocalVariableInspection + */ $oContextTag = new ContextTag(ContextTag::TAG_SETUP); SetupLog::Info("Compiling data model."); @@ -476,7 +476,9 @@ class ApplicationInstallSequencer extends StepSequencer if (is_file($sConfigFilePath)) { $oConfig = new Config($sConfigFilePath); $oConfig->UpdateFromParams($aParamValues); - SetupUtils::EnterMaintenanceMode($oConfig); + if ($bEnterMaintenanceMode) { + SetupUtils::EnterMaintenanceMode($oConfig); + } } } try { @@ -531,7 +533,7 @@ class ApplicationInstallSequencer extends StepSequencer } $oMFCompiler = new MFCompiler($oFactory, $sEnvironment); - $oMFCompiler->Compile($sTargetPath, null, $bUseSymbolicLinks); + $oMFCompiler->Compile($sTargetPath, null, $bUseSymbolicLinks, false, $bEnterMaintenanceMode); //$aCompilerLog = $oMFCompiler->GetLog(); //SetupLog::Info(implode("\n", $aCompilerLog)); SetupLog::Info("Data model successfully compiled to '$sTargetPath'."); @@ -563,7 +565,7 @@ class ApplicationInstallSequencer extends StepSequencer $sIntanceUUID = utils::CreateUUID('filesystem'); file_put_contents($sInstanceUUIDFile, $sIntanceUUID); } - if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) { + if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) { SetupUtils::ExitMaintenanceMode(); } } diff --git a/setup/sequencers/DataAuditSequencer.php b/setup/sequencers/DataAuditSequencer.php index 847b2f3ae..a65ed6920 100644 --- a/setup/sequencers/DataAuditSequencer.php +++ b/setup/sequencers/DataAuditSequencer.php @@ -57,7 +57,6 @@ class DataAuditSequencer extends ApplicationInstallSequencer try { $fStart = microtime(true); SetupLog::Info("##### STEP {$sStep} start"); - $this->EnterReadOnlyMode(); switch ($sStep) { case '': $this->DoLogParameters('data-audit-', 'Data Audit'); @@ -83,6 +82,7 @@ class DataAuditSequencer extends ApplicationInstallSequencer $aSelectedModules, $sSourceDir, $sExtensionDir, + false, false ); @@ -145,7 +145,6 @@ class DataAuditSequencer extends ApplicationInstallSequencer ]; $this->ReportException($e); - $this->ExitReadOnlyMode(); } finally { $fDuration = round(microtime(true) - $fStart, 2); SetupLog::Info("##### STEP {$sStep} duration: {$fDuration}s");