Make setup backup location and name similar as other backups (#61)

This commit is contained in:
Thomas Casteleyn
2019-03-22 16:02:17 +01:00
committed by Pierre Goiffon
parent da6791d75f
commit 6e8bcf7b69
2 changed files with 13 additions and 3 deletions

View File

@@ -460,11 +460,12 @@ class SetupUtils
/**
* Check that the backup could be executed
* @param $sDestDir
* @param $sDBBackupPath
* @param $sMySQLBinDir
* @return array An array of CheckResults objects
* @internal param Page $oP The page used only for its 'log' method
*/
static function CheckBackupPrerequisites($sDestDir, $sMySQLBinDir = null)
static function CheckBackupPrerequisites($sDBBackupPath, $sMySQLBinDir = null)
{
$aResult = array();
SetupPage::log('Info - CheckBackupPrerequisites');
@@ -529,6 +530,15 @@ class SetupUtils
{
SetupPage::log('Info - mysqldump -V said: '.$sLine);
}
// create and test destination location
//
$sDestDir = dirname($sDBBackupPath);
setuputils::builddir($sDestDir);
if (!is_dir($sDestDir))
{
$aResult[] = new CheckResult(CheckResult::ERROR, "$sDestDir does not exist and could not be created.");
}
// check disk space
// to do... evaluate how we can correlate the DB size with the size of the dump (and the zip!)