// to the backup, settings, license, versions and other useful information
$this->add_step(new backup_main_structure_step('mainfile', 'moodle_backup.xml'));
- // Generate the zip file
+ // Generate the zip file (mbz extension)
$this->add_step(new backup_zip_contents('zip_contents'));
- // Copy the generated zip file to final destination
+ // Copy the generated zip (.mbz) file to final destination
$this->add_step(new backup_store_backup_file('save_backupfile'));
// Clean the temp dir (conditionally) and drop temp table
protected function define_settings() {
// Define filename setting
- $filename = new backup_filename_setting('filename', base_setting::IS_FILENAME, 'backup.zip');
- $filename->set_ui(get_string('filename', 'backup'), 'backup.zip', array('size'=>50));
+ $filename = new backup_filename_setting('filename', base_setting::IS_FILENAME, 'backup.mbz');
+ $filename->set_ui(get_string('filename', 'backup'), 'backup.mbz', array('size'=>50));
$this->add_setting($filename);
// Define users setting (keeping it on hand to define dependencies)
}
/**
- * Execution step that will generate the final zip file with all the contents
+ * Execution step that will generate the final zip (.mbz) file with all the contents
*/
class backup_zip_contents extends backup_execution_step {
$files['moodle_backup.log'] = $logfilepath;
}
- // Calculate the zip fullpath (in OS temp area it's always backup.zip)
- $zipfile = $basepath . '/backup.zip';
+ // Calculate the zip fullpath (in OS temp area it's always backup.mbz)
+ $zipfile = $basepath . '/backup.mbz';
// Get the zip packer
$zippacker = get_file_packer('application/zip');
// Get basepath
$basepath = $this->get_basepath();
- // Calculate the zip fullpath (in OS temp area it's always backup.zip)
- $zipfile = $basepath . '/backup.zip';
+ // Calculate the zip fullpath (in OS temp area it's always backup.mbz)
+ $zipfile = $basepath . '/backup.mbz';
// 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));
* Returns the default backup filename, based in passed params.
*
* Default format is (see MDL-22145)
- * backup word - format - type - name - date - info . zip
+ * backup word - format - type - name - date - info . mbz
* where name is variable (course shortname, section name/id, activity modulename + cmid)
* and info can be (nu = no user info, an = anonymized)
*/
}
return $backupword . '-' . $format . '-' . $type . '-' .
- $name . '-' . $date . $info . '.zip';
+ $name . '-' . $date . $info . '.mbz';
}
/**
if (!array_key_exists('setting_root_filename', $errors)) {
if (trim($data['setting_root_filename']) == '') {
$errors['setting_root_filename'] = get_string('errorfilenamerequired', 'backup');
- } else if (!preg_match('#\.zip$#i', $data['setting_root_filename'])) {
+ } else if (!preg_match('#\.mbz$#i', $data['setting_root_filename'])) {
$errors['setting_root_filename'] = get_string('errorfilenamemustbezip', 'backup');
}
}
foreach ($this->ui->get_tasks() as $task) {
if ($setting = $task->get_setting('filename')) {
$form->add_heading('filenamesetting', get_string('filename', 'backup'));
- if ($setting->get_value() == 'backup.zip') {
+ if ($setting->get_value() == 'backup.mbz') {
$format = $this->ui->get_format();
$type = $this->ui->get_type();
$id = $this->ui->get_controller_id();
$string['currentstage16'] = 'Complete';
$string['dependenciesenforced'] = 'Your settings have been altered due to unmet dependencies';
$string['errorfilenamerequired'] = 'You must enter a valid filename for this backup';
-$string['errorfilenamemustbezip'] = 'The filename you enter must be a ZIP file and have the .zip extension';
+$string['errorfilenamemustbezip'] = 'The filename you enter must be a ZIP file and have the .mbz extension';
$string['errorminbackup20version'] = 'This backup file has been created with one development version of Moodle backup ({$a->backup}). Minimum required is {$a->min}. Cannot be restored.';
$string['errorrestorefrontpage'] = 'Restoring over front page is not allowed.';
$string['executionsuccess'] = 'The backup file was successfully created.';