Compare commits

..

1 Commits

4 changed files with 4 additions and 17 deletions

View File

@@ -179,7 +179,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
assert($oLink instanceof $this->sClass);
$iObjectId = $oLink->GetKey();
if (array_key_exists($iObjectId, $this->aPreserved)) {
if (array_key_exists($iObjectId, $this->aPreserved) && !$oLink->Equals(MetaModel::GetObject(get_class($oLink), $iObjectId, true))) {
unset($this->aPreserved[$iObjectId]);
$this->aModified[$iObjectId] = $oLink;
$this->bHasDelta = true;

View File

@@ -96,7 +96,7 @@ try {
//
$sMySQLBinDir = MetaModel::GetConfig()->GetModuleSetting('itop-backup', 'mysql_bindir', '');
$sMySQLBinDir = utils::ReadParam('mysql_bindir', $sMySQLBinDir, true);
$sMySQLDump = DBBackup::MakeSafeMySQLCommand($sMySQLBinDir, DBBackup::GetDumpFunction());
$sMySQLDump = DBBackup::MakeSafeMySQLCommand($sMySQLBinDir, 'mysqldump');
$sCommand = "$sMySQLDump -V 2>&1";
$aOutput = [];

View File

@@ -346,7 +346,7 @@ class DBBackup
$this->LogInfo("Starting backup of $this->sDBHost/$this->sDBName(suffix:'$this->sDBSubName')");
$sMySQLBinDir = utils::ReadParam('mysql_bindir', $this->sMySQLBinDir, true);
$sMySQLDump = $this->MakeSafeMySQLCommand($sMySQLBinDir, DBBackup::GetDumpFunction());
$sMySQLDump = $this->MakeSafeMySQLCommand($sMySQLBinDir, 'mysqldump');
// Store the results in a temporary file
$sTmpFileName = self::EscapeShellArg($sBackupFileName);
@@ -603,16 +603,6 @@ EOF;
return '"'.$sMySQLCommand.'"';
}
public static function GetDumpFunction(): string
{
$sVersion = CMDBSource::GetDBVersion();
if (stripos($sVersion, 'MariaDB') !== false) {
return 'mariadb-dump';
}
return 'mysqldump';
}
}
class TarGzArchive implements BackupArchive

View File

@@ -559,15 +559,12 @@ class SetupUtils
$aResult[] = new CheckResult(CheckResult::ERROR, "The PHP exec() function has been disabled on this server");
}
MetaModel::LoadConfig(utils::GetConfig());
// availability of mysqldump
if (empty($sMySQLBinDir) && null != MetaModel::GetConfig()) {
$sMySQLBinDir = MetaModel::GetConfig()->GetModuleSetting('itop-backup', 'mysql_bindir', '');
}
try {
$oConfig = MetaModel::GetConfig();
CMDBSource::InitFromConfig($oConfig);
$sMySQLDump = DBBackup::MakeSafeMySQLCommand($sMySQLBinDir, DBBackup::GetDumpFunction());
$sMySQLDump = DBBackup::MakeSafeMySQLCommand($sMySQLBinDir, 'mysqldump');
} catch (Exception $e) {
$aResult[] = new CheckResult(CheckResult::ERROR, $e->getMessage());
return $aResult;