[MDL-15300] Remove temporary files created while exporting a preset as ZIP file. Merged from MOODLE_19_STABLE.

This commit is contained in:
robertall
2008-06-18 14:49:44 +00:00
parent 1f5645bc57
commit a4736e2808
+6 -3
View File
@@ -494,12 +494,15 @@ function data_presets_export($course, $cm, $data) {
}
$exportfile = "$CFG->dataroot/$course->id/moddata/data/$data->id/$presetname.zip";
@unlink($exportfile);
unlink($exportfile);
$status = zip_files($filelist, $exportfile);
// ToDo: status check
// ToDo: remove temporary files
foreach ($filelist as $file) {
unlink($file);
}
rmdir($exportdir);
// Return the full path to the ZIP file to be exported:
// Return the full path to the exported preset file:
return $exportfile;
}