Skip to content

Commit

Permalink
MDL-33812 Backup: Revert MDL-33521
Browse files Browse the repository at this point in the history
Conflicts:

	backup/util/helper/backup_cron_helper.class.php
  • Loading branch information
Frederic Massart committed Sep 3, 2012
1 parent cdf58e6 commit 85616ca
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions backup/util/helper/backup_cron_helper.class.php
Expand Up @@ -530,17 +530,7 @@ public static function remove_excess_backups($course) {
if (!empty($dir) && ($storage == 1 || $storage == 2)) { if (!empty($dir) && ($storage == 1 || $storage == 2)) {
// Calculate backup filename regex, ignoring the date/time/info parts that can be // Calculate backup filename regex, ignoring the date/time/info parts that can be
// variable, depending of languages, formats and automated backup settings // variable, depending of languages, formats and automated backup settings

$filename = $backupword . '-' . backup::FORMAT_MOODLE . '-' . backup::TYPE_1COURSE . '-' .$course->id . '-';
// MDL-33531: use different filenames depending on backup_shortname option
if ( !empty($config->backup_shortname) ) {
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$courseref = format_string($course->shortname, true, array('context' => $context));
$courseref = str_replace(' ', '_', $courseref);
$courseref = moodle_strtolower(trim(clean_filename($courseref), '_'));
} else {
$courseref = $course->id;
}
$filename = $backupword . '-' . backup::FORMAT_MOODLE . '-' . backup::TYPE_1COURSE . '-' .$courseref . '-';
$regex = '#^'.preg_quote($filename, '#').'.*\.mbz$#'; $regex = '#^'.preg_quote($filename, '#').'.*\.mbz$#';


// Store all the matching files into fullpath => timemodified array // Store all the matching files into fullpath => timemodified array
Expand Down

0 comments on commit 85616ca

Please sign in to comment.