]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18818 - don't define var if already defined - happens when these functions are...
authordanmarsden <danmarsden>
Wed, 15 Apr 2009 02:16:17 +0000 (02:16 +0000)
committerdanmarsden <danmarsden>
Wed, 15 Apr 2009 02:16:17 +0000 (02:16 +0000)
backup/lib.php

index e635b0caa880f2b5ecacd0015f390c2583410fa3..30746b2b120a24956901ae333357afc4e6792f6a 100644 (file)
         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;
     */
     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;