From 9c808bf2eddf1f8178794676dd23a492fdf172fe Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 13 Nov 2019 13:50:48 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02240=20-=20Supportability=20-=20Maintena?= =?UTF-8?q?nce=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/applicationinstaller.class.inc.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index 1f11d8bdd..b8fd2a280 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -540,10 +540,26 @@ class ApplicationInstaller $aDirsToScan[] = $sExtraPath; } $sTargetPath = APPROOT.$sTargetDir; + if (!is_dir($sSourcePath)) { throw new Exception("Failed to find the source directory '$sSourcePath', please check the rights of the web server"); - } + } + $bIsAlreadyInMaintenanceMode = SetupUtils::IsInMaintenanceMode(); + if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) + { + $sConfigFilePath = utils::GetConfigFilePath($sEnvironment); + if (is_file($sConfigFilePath)) + { + $oConfig = new Config($sConfigFilePath); + } + else + { + $oConfig = null; + } + SetupUtils::EnterMaintenanceMode($oConfig); + } + if (!is_dir($sTargetPath)) { if (!mkdir($sTargetPath)) @@ -631,6 +647,10 @@ class ApplicationInstaller $sIntanceUUID = utils::CreateUUID('filesystem'); file_put_contents($sInstanceUUIDFile, $sIntanceUUID); } + if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) + { + SetupUtils::ExitMaintenanceMode(); + } } /**