mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-64290 backup imscc: Use correct tempdir for imscc restore
Use configured temp directory $CFG->tempdir instead of hard coded $CFG->dataroot . '/temp/backup/' Remove unused variable, $CFG
This commit is contained in:
parent
df6d0b6d45
commit
f1a22c4a1b
@ -37,9 +37,10 @@ class imscc1_converter extends base_converter {
|
||||
* @return null|string backup::FORMAT_IMSCC1 if the Common Cartridge 1.0 is detected, null otherwise
|
||||
*/
|
||||
public static function detect_format($tempdir) {
|
||||
global $CFG;
|
||||
|
||||
$filepath = $CFG->dataroot . '/temp/backup/' . $tempdir;
|
||||
$filepath = make_backup_temp_directory($tempdir, false);
|
||||
if (!is_dir($filepath)) {
|
||||
throw new convert_helper_exception('tmp_backup_directory_not_found', $filepath);
|
||||
}
|
||||
$manifest = cc2moodle::get_manifest($filepath);
|
||||
if (!empty($manifest)) {
|
||||
// Looks promising, lets load some information.
|
||||
|
@ -38,9 +38,10 @@ class imscc11_converter extends base_converter {
|
||||
* @return null|string backup::FORMAT_IMSCC11 if the Common Cartridge 1.1 is detected, null otherwise
|
||||
*/
|
||||
public static function detect_format($tempdir) {
|
||||
global $CFG;
|
||||
|
||||
$filepath = $CFG->dataroot . '/temp/backup/' . $tempdir;
|
||||
$filepath = make_backup_temp_directory($tempdir, false);
|
||||
if (!is_dir($filepath)) {
|
||||
throw new convert_helper_exception('tmp_backup_directory_not_found', $filepath);
|
||||
}
|
||||
$manifest = cc112moodle::get_manifest($filepath);
|
||||
if (file_exists($manifest)) {
|
||||
// Looks promising, lets load some information.
|
||||
|
Loading…
x
Reference in New Issue
Block a user