moodle/backup/try.php
nicolasconnault 7c08ef3653 Fixed MDL-8582
Not sure if the hotpot module is converting ampersands correctly. $heading and $title are set up differently than in other modules: instead of outputting $course->title, a temporary $title variable is created and assigned that value. That made it difficult for me to decide whether it was already formatted elsewhere or not.

Also I didn't format_string() any of the variables included in $navigation rings, because I assume these strings get processed by print_navigation(), which includes format_string().
2007-02-28 05:36:13 +00:00

41 lines
1.2 KiB
PHP

<?PHP //$Id$
require_once ("../config.php");
require_once ("backup_scheduled.php");
require_once ("lib.php");
require_once ("backuplib.php");
require_once ("$CFG->libdir/blocklib.php");
require_login();
require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID));
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Check necessary functions exists. Thanks to gregb@crowncollege.edu
backup_required_functions();
//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","3000");
raise_memory_limit("192M");
echo "<pre>\n";
$status = true;
$courses = get_records("course");
foreach ($courses as $course) {
echo "Start course ". format_string($course->fullname);
$preferences = schedule_backup_course_configure($course);
if ($preferences && $status) {
$status = schedule_backup_course_execute($preferences);
}
if ($status && $preferences) {
echo "End course ". format_string($course->fullname)." OK\n\n";
} else {
echo "End course ". format_string($course->fullname)." FAIL\n\n";
}
}
?>