MDL-13114 tool_uploadcourse: Use autoload and clean require_once
authorFrederic Massart <fred@moodle.com>
Mon, 1 Jul 2013 07:59:35 +0000 (15:59 +0800)
committerFrederic Massart <fred@moodle.com>
Mon, 15 Jul 2013 02:02:55 +0000 (10:02 +0800)
admin/tool/uploadcourse/classes/course.php
admin/tool/uploadcourse/classes/helper.php
admin/tool/uploadcourse/classes/processor.php
admin/tool/uploadcourse/classes/tracker.php
admin/tool/uploadcourse/cli/uploadcourse.php
admin/tool/uploadcourse/tests/course_test.php
admin/tool/uploadcourse/tests/helper_test.php
admin/tool/uploadcourse/tests/processor_test.php

index abb3ee0..2812a7f 100644 (file)
@@ -23,6 +23,8 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
+require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
+require_once($CFG->dirroot . '/course/lib.php');
 
 /**
  * Course class.
index cb15e96..c5f5156 100644 (file)
@@ -23,6 +23,9 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
+require_once($CFG->libdir . '/coursecatlib.php');
+require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
+require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
 
 /**
  * Class containing a set of helpers.
index e29f622..800daf8 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
+require_once($CFG->libdir . '/csvlib.class.php');
 
 /**
  * Processor class.
index 2dc6be5..3adca67 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
+require_once($CFG->libdir . '/weblib.php');
 
 /**
  * Class output tracker.
index bdf0819..573af09 100644 (file)
@@ -172,7 +172,7 @@ if (isset($options['templatecourse'])) {
     $processoroptions['templatecourse'] = $options['templatecourse'];
 }
 
-// Backup file.
+// Restore file.
 if ($options['restorefile']) {
     $options['restorefile'] = realpath($options['restorefile']);
 }
index c1af49e..d5dfb9b 100644 (file)
 defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/processor.php');
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/course.php');
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/helper.php');
-require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
-require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
-require_once($CFG->libdir . '/csvlib.class.php');
-require_once($CFG->libdir . '/coursecatlib.php');
 
 /**
  * Course test case.
index 344c13c..a17e543 100644 (file)
@@ -25,9 +25,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/helper.php');
-require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
-require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
 
 /**
  * Helper test case.
index 1f61bfa..5385dde 100644 (file)
 defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/processor.php');
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/course.php');
-require_once($CFG->dirroot . '/admin/tool/uploadcourse/classes/helper.php');
-require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
-require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
-require_once($CFG->libdir . '/csvlib.class.php');
 
 /**
  * Processor test case.