mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°4227 / N°4225 - Enhance SetupUtils interface
This commit is contained in:
@@ -133,8 +133,7 @@ class DBRestore extends DBBackup
|
||||
|
||||
try {
|
||||
IssueLog::Info('Backup Restore - LOCK acquired, executing...');
|
||||
$bReadonlyBefore = SetupUtils::IsInReadOnlyMode();
|
||||
SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
|
||||
$bReadonlyBefore = SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
|
||||
|
||||
try {
|
||||
//safe zone for db backup => cron is stopped/ itop in readonly
|
||||
|
||||
@@ -172,8 +172,7 @@ class DBBackup
|
||||
*/
|
||||
public function CreateCompressedBackup($sTargetFile, $sSourceConfigFile = null)
|
||||
{
|
||||
$bReadonlyBefore = SetupUtils::IsInReadOnlyMode();
|
||||
SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
|
||||
$bReadonlyBefore = SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
|
||||
try {
|
||||
//safe zone for db backup => cron is stopped/ itop in readonly
|
||||
$bIsCmdbSourceInitialized = CMDBSource::GetMysqli() instanceof mysqli;
|
||||
|
||||
@@ -1988,11 +1988,13 @@ JS
|
||||
return APPROOT.'log/setup-queries-'.strftime('%Y-%m-%d_%H_%M').'.sql';
|
||||
}
|
||||
|
||||
public static function EnterMaintenanceMode($oConfig)
|
||||
public static function EnterMaintenanceMode($oConfig): bool
|
||||
{
|
||||
$bPreviousMode = self::IsInMaintenanceMode();
|
||||
@touch(MAINTENANCE_MODE_FILE);
|
||||
self::Log("----> Entering maintenance mode");
|
||||
self::WaitCronTermination($oConfig, "maintenance");
|
||||
return $bPreviousMode;
|
||||
}
|
||||
|
||||
public static function ExitMaintenanceMode($bLog = true)
|
||||
@@ -2009,11 +2011,13 @@ JS
|
||||
return file_exists(MAINTENANCE_MODE_FILE);
|
||||
}
|
||||
|
||||
public static function EnterReadOnlyMode($oConfig)
|
||||
public static function EnterReadOnlyMode($oConfig): bool
|
||||
{
|
||||
$bPreviousMode = self::IsInReadOnlyMode();
|
||||
@touch(READONLY_MODE_FILE);
|
||||
self::Log("----> Entering read only mode");
|
||||
self::WaitCronTermination($oConfig, "read only");
|
||||
return $bPreviousMode;
|
||||
}
|
||||
|
||||
public static function ExitReadOnlyMode($bLog = true)
|
||||
|
||||
Reference in New Issue
Block a user