MDL-33812 Backup: Added some upgrade information about the changes

This commit is contained in:
Frederic Massart
2012-09-03 14:10:59 +08:00
parent 2fd679c5e1
commit 640f8eed6d
2 changed files with 22 additions and 5 deletions
+17
View File
@@ -0,0 +1,17 @@
This files describes API changes in /backup/*,
information provided here is intended especially for developers.
=== 2.4 ===
* Since 2.3.1+ the backup file name schema has changed. The ID of the course will always be part of
the filename regardless of the setting 'backup_shortname'. See MDL-33812.
=== 2.3 ===
* Since 2.3.1+ the backup file name schema has changed. The ID of the course will always be part of
the filename regardless of the setting 'backup_shortname'. See MDL-33812.
=== 2.2 ===
* Since 2.2.4+ the backup file name schema has changed. The ID of the course will always be part of
the filename regardless of the setting 'backup_shortname'. See MDL-33812.
@@ -197,19 +197,19 @@ abstract class backup_plan_dbops extends backup_dbops {
* @param int $courseid/$sectionid/$cmid
* @param bool $users Should be true is users were included in the backup
* @param bool $anonymised Should be true is user information was anonymized.
* @param bool $withoutname if false, include the name in the file name (default)
* @param bool $useidonly only use the ID in the file name
* @return string The filename to use
*/
public static function get_default_backup_filename($format, $type, $id, $users, $anonymised, $withoutname = false) {
public static function get_default_backup_filename($format, $type, $id, $users, $anonymised, $useidonly = false) {
global $DB;
// Calculate backup word
$backupword = str_replace(' ', '_', textlib::strtolower(get_string('backupfilename')));
$backupword = trim(clean_filename($backupword), '_');
// Not $withoutname, lets fetch the name
// Not $useidonly, lets fetch the name
$shortname = '';
if (!$withoutname) {
if (!$useidonly) {
// Calculate proper name element (based on type)
switch ($type) {
case backup::TYPE_1COURSE:
@@ -233,7 +233,7 @@ abstract class backup_plan_dbops extends backup_dbops {
// The name will always contain the ID, but we append the course short name if requested.
$name = $id;
if (!$withoutname && $shortname != '') {
if (!$useidonly && $shortname != '') {
$name .= '-' . $shortname;
}