N°2240 - Supportability - Maintenance mode

This commit is contained in:
Eric
2019-11-07 09:16:06 +01:00
parent 7d8181c44f
commit d035130d00
9 changed files with 99 additions and 27 deletions

View File

@@ -192,10 +192,7 @@ class ApplicationInstaller
try
{
$fStart = microtime(true);
if ($bSwitchToMaintenance)
{
SetupUtils::EnterMaintenanceMode($this->GetConfig());
}
$this->EnterReadOnlyMode();
switch ($sStep)
{
case '':
@@ -389,6 +386,7 @@ class ApplicationInstaller
'next-step-label' => 'Completed',
'percentage-completed' => 100,
);
$this->ExitReadOnlyMode();
break;
@@ -431,10 +429,6 @@ class ApplicationInstaller
}
finally
{
if ($bSwitchToMaintenance)
{
SetupUtils::ExitMaintenanceMode();
}
$fDuration = round(microtime(true) - $fStart, 2);
SetupPage::log_info("##### STEP {$sStep} duration: {$fDuration}s");
}
@@ -442,6 +436,37 @@ class ApplicationInstaller
return $aResult;
}
private function EnterReadOnlyMode()
{
if ($this->GetTargetEnv() != 'production')
{
return;
}
if (SetupUtils::IsInReadOnlyMode())
{
return;
}
SetupUtils::EnterReadOnlyMode($this->GetConfig());
}
private function ExitReadOnlyMode()
{
if ($this->GetTargetEnv() != 'production')
{
return;
}
if (!SetupUtils::IsInReadOnlyMode())
{
return;
}
SetupUtils::ExitReadOnlyMode();
}
protected static function DoCopy($aCopies)
{
$aReports = array();