Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 726f4ca317
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 44 lines (35 sloc) 1.236 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?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();

    if (!isadmin()) {
        error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
    }

    //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("128M");

    echo "<pre>\n";

    $status = true;

    $courses = get_records("course");
    foreach ($courses as $course) {
        echo "Start course ".$course->fullname;
        $preferences = schedule_backup_course_configure($course);
        if ($preferences && $status) {
            $status = schedule_backup_course_execute($preferences);
        }
        if ($status && $preferences) {
            echo "End course ".$course->fullname." OK\n\n";
        } else {
            echo "End course ".$course->fullname." FAIL\n\n";
        }
    }
?>
Something went wrong with that request. Please try again.