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:
@@ -375,9 +375,9 @@ class publication {
|
||||
global $CFG, $USER;
|
||||
require_once($CFG->libdir . "/filelib.php");
|
||||
|
||||
make_temp_directory('backup');
|
||||
$backuptempdir = make_backup_temp_directory('');
|
||||
$filename = md5(time() . '-' . $hubcourseid . '-'. $USER->id . '-'. random_string(20));
|
||||
$path = $CFG->tempdir.'/backup/'.$filename.".mbz";
|
||||
$path = $backuptempdir.'/'.$filename.".mbz";
|
||||
|
||||
api::download_course_backup($hubcourseid, $path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user