MDL-60923 backup: Added $CFG->backuptempdir
The new setting will allow to host the temporary backup files into a specific target directory. Defaults to '$CFG->tempdir/backup'. Calling make_backup_temp_directory() checks that the required sub-directory will be properly created under the new target directory.
This commit is contained in:
@@ -110,7 +110,7 @@ class core_backup_controller_testcase extends advanced_testcase {
|
||||
global $CFG;
|
||||
|
||||
// Make a backup.
|
||||
check_dir_exists($CFG->tempdir . '/backup');
|
||||
make_backup_temp_directory('');
|
||||
$bc = new backup_controller(backup::TYPE_1ACTIVITY, $this->moduleid, backup::FORMAT_MOODLE,
|
||||
backup::INTERACTIVE_NO, backup::MODE_IMPORT, $this->userid);
|
||||
$backupid = $bc->get_backupid();
|
||||
@@ -159,7 +159,7 @@ class core_backup_controller_testcase extends advanced_testcase {
|
||||
|
||||
$foldername = 'deadlock';
|
||||
$fp = get_file_packer('application/vnd.moodle.backup');
|
||||
$tempdir = $CFG->dataroot . '/temp/backup/' . $foldername;
|
||||
$tempdir = make_backup_temp_directory($foldername);
|
||||
$files = $fp->extract_to_pathname($CFG->dirroot . '/backup/controller/tests/fixtures/deadlock.mbz', $tempdir);
|
||||
|
||||
$this->setAdminUser();
|
||||
|
||||
Reference in New Issue
Block a user