Setup: fixed issue when upgrading a DB (no install dir specified, thus no config file) and requesting a backup: the backup is created without the config file in it.

(Updated the readme for the upcoming release!)

SVN:trunk[3037]
This commit is contained in:
Romain Quetiez
2013-12-10 15:47:33 +00:00
parent cfd2a7baff
commit 934e500253
2 changed files with 14 additions and 11 deletions

View File

@@ -112,23 +112,26 @@ class DBBackup
$sDataFile = tempnam(SetupUtils::GetTmpDir(), 'itop-');
$this->LogInfo("Data file: '$sDataFile'");
$aContents = array();
$aContents[] = array(
'source' => $sDataFile,
'dest' => 'itop-dump.sql',
);
if (is_null($sSourceConfigFile))
{
$sSourceConfigFile = MetaModel::GetConfig()->GetLoadedFile();
}
if (!empty($sSourceConfigFile))
{
$aContents[] = array(
'source' => $sSourceConfigFile,
'dest' => 'config-itop.php',
);
}
$this->DoBackup($sDataFile);
$aContents = array(
array(
'source' => $sDataFile,
'dest' => 'itop-dump.sql',
),
array(
'source' => $sSourceConfigFile,
'dest' => 'config-itop.php',
),
);
$sDeltaFile = APPROOT.'data/'.utils::GetCurrentEnvironment().'.delta.xml';
if (file_exists($sDeltaFile))
{