mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°2240 - Supportability - Maintenance mode
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user