file courseidnumber.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12...
[moodle.git] / backup / try.php
blob34ad2ff407f0f01fb9029c936a391a38f284daab
1 <?PHP //$Id$
2 require_once ("../config.php");
3 require_once ("backup_scheduled.php");
4 require_once ("lib.php");
5 require_once ("backuplib.php");
6 require_once ("$CFG->libdir/blocklib.php");
8 require_login();
10 if (!isadmin()) {
11 error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
14 //Check site
15 if (!$site = get_site()) {
16 error("Site not found!");
19 //Check necessary functions exists. Thanks to gregb@crowncollege.edu
20 backup_required_functions();
22 //Adjust some php variables to the execution of this script
23 @ini_set("max_execution_time","3000");
24 raise_memory_limit("128M");
26 echo "<pre>\n";
28 $status = true;
30 $courses = get_records("course");
31 foreach ($courses as $course) {
32 echo "Start course ".$course->fullname;
33 $preferences = schedule_backup_course_configure($course);
34 if ($preferences && $status) {
35 $status = schedule_backup_course_execute($preferences);
37 if ($status && $preferences) {
38 echo "End course ".$course->fullname." OK\n\n";
39 } else {
40 echo "End course ".$course->fullname." FAIL\n\n";