$files['moodle_backup.log'] = $logfilepath;
}
- // Calculate the zip fullpath
- $zipfile = $basepath . '/' . $this->get_setting_value('filename');
+ // Calculate the zip fullpath (in OS temp area it's always backup.zip)
+ $zipfile = $basepath . '/backup.zip';
// Get the zip packer
$zippacker = get_file_packer('application/zip');
// Get basepath
$basepath = $this->get_basepath();
- // Calculate the zip fullpath
- $zipfile = $basepath . '/' . $this->get_setting_value('filename');
+ // Calculate the zip fullpath (in OS temp area it's always backup.zip)
+ $zipfile = $basepath . '/backup.zip';
// Perform storage and return it (TODO: shouldn't be array but proper result object)
return array('backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile));
// Extract useful information to decide
$hasusers = (bool)$sinfo['users']->value; // Backup has users
$isannon = (bool)$sinfo['anonymize']->value; // Backup is annonymzed
+ $filename = $sinfo['filename']->value; // Backup filename
$backupmode= $dinfo[0]->mode; // Backup mode backup::MODE_GENERAL/IMPORT/HUB
$backuptype= $dinfo[0]->type; // Backup type backup::TYPE_1ACTIVITY/SECTION/COURSE
$userid = $dinfo[0]->userid; // User->id executing the backup
'filearea' => $filearea,
'itemid' => $itemid,
'filepath' => '/',
- 'filename' => basename($filepath),
+ 'filename' => $filename,
'userid' => $userid,
'timecreated' => time(),
'timemodified'=> time());