N°2240 - Supportability - Maintenance mode

This commit is contained in:
Eric
2019-11-13 13:50:48 +01:00
parent 7a12c2c615
commit 9c808bf2ed

View File

@@ -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();
}
}
/**