mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 01:58:47 +02:00
N°9144 - tests and fixes
This commit is contained in:
@@ -648,6 +648,15 @@ class RunTimeEnvironment
|
||||
}
|
||||
}
|
||||
|
||||
public function SetDbUUID() : void {
|
||||
// Set a DBProperty with a unique ID to identify this instance of iTop
|
||||
$sUUID = DBProperty::GetProperty('database_uuid', '');
|
||||
if ($sUUID === '') {
|
||||
$sUUID = utils::CreateUUID('database');
|
||||
DBProperty::SetProperty('database_uuid', $sUUID, 'Installation/upgrade of '.ITOP_APPLICATION, 'Unique ID of this '.ITOP_APPLICATION.' Database');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Config $oConfig
|
||||
* @param array|null $aSelectedModules null means all
|
||||
@@ -1530,6 +1539,32 @@ class RunTimeEnvironment
|
||||
$oBackup->CreateCompressedBackup($sTargetFile, $sSourceConfigFile);
|
||||
}
|
||||
|
||||
public function EnterReadOnlyMode(Config $oConfig)
|
||||
{
|
||||
if ($this->GetFinalEnv() != 'production') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SetupUtils::IsInReadOnlyMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetupUtils::EnterReadOnlyMode($oConfig);
|
||||
}
|
||||
|
||||
public function ExitReadOnlyMode()
|
||||
{
|
||||
if ($this->GetFinalEnv() != 'production') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetupUtils::IsInReadOnlyMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetupUtils::ExitReadOnlyMode();
|
||||
}
|
||||
|
||||
public function GetFinalEnv(): string
|
||||
{
|
||||
return $this->sFinalEnv;
|
||||
|
||||
Reference in New Issue
Block a user