Skip to content

Commit

Permalink
MDL-18818 - don't define var if already defined - happens when these …
Browse files Browse the repository at this point in the history
…functions are called more than once at a time.
  • Loading branch information
danmarsden committed Apr 15, 2009
1 parent 4f76747 commit 062173b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backup/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ function import_backup_file_silently($pathtofile,$destinationcourse,$emptyfirst=
global $CFG,$SESSION,$USER, $DB; // is there such a thing on cron? I guess so..
global $restore; // ick

define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
if (!defined('RESTORE_SILENTLY')) {
define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
}

$debuginfo = 'import_backup_file_silently: ';
$cleanupafter = false;
Expand Down Expand Up @@ -618,7 +620,9 @@ function import_backup_file_silently($pathtofile,$destinationcourse,$emptyfirst=
*/
function backup_course_silently($courseid, $prefs, &$errorstring) {
global $CFG, $preferences, $DB; // global preferences here because something else wants it :(
define('BACKUP_SILENTLY', 1);
if (!defined('BACKUP_SILENTLY')) {
define('BACKUP_SILENTLY', 1);
}
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
debugging("Couldn't find course with id $courseid in backup_course_silently");
return false;
Expand Down

0 comments on commit 062173b

Please sign in to comment.