|
Moodle
2.2.1
http://www.collinsharper.com
|
Static Public Member Functions | |
| static | run_automated_backup ($rundirective=self::RUN_ON_SCHEDULE) |
| static | get_backup_status_array () |
| static | calculate_next_automated_backup ($timezone, $now) |
| static | launch_automated_backup ($course, $starttime, $userid) |
| static | remove_deleted_courses_from_schedule () |
| static | get_automated_backup_state ($rundirective=self::RUN_ON_SCHEDULE) |
| static | set_state_running ($running=true) |
| static | remove_excess_backups ($course) |
Data Fields | |
| const | STATE_OK = 0 |
| const | STATE_DISABLED = 1 |
| const | STATE_RUNNING = 2 |
| const | BACKUP_STATUS_OK = 1 |
| const | BACKUP_STATUS_ERROR = 0 |
| const | BACKUP_STATUS_UNFINISHED = 2 |
| const | BACKUP_STATUS_SKIPPED = 3 |
| const | RUN_ON_SCHEDULE = 0 |
| const | RUN_IMMEDIATELY = 1 |
| const | AUTO_BACKUP_DISABLED = 0 |
| const | AUTO_BACKUP_ENABLED = 1 |
| const | AUTO_BACKUP_MANUAL = 2 |
This class is an abstract class with methods that can be called to aid the running of automated backups over cron.
Definition at line 32 of file backup_cron_helper.class.php.
| static calculate_next_automated_backup | ( | $ | timezone, |
| $ | now | ||
| ) | [static] |
Works out the next time the automated backup should be run.
| mixed | $timezone | |
| int | $now |
Definition at line 277 of file backup_cron_helper.class.php.


| static get_automated_backup_state | ( | $ | rundirective = self::RUN_ON_SCHEDULE | ) | [static] |
Gets the state of the automated backup system.
moodle_database $DB
Definition at line 406 of file backup_cron_helper.class.php.


| static get_backup_status_array | ( | ) | [static] |
Gets the results from the last automated backup that was run based upon the statuses of the courses that were looked at.
moodle_database $DB
Definition at line 248 of file backup_cron_helper.class.php.

| static launch_automated_backup | ( | $ | course, |
| $ | starttime, | ||
| $ | userid | ||
| ) | [static] |
Launches a automated backup routine for the given course
| stdClass | $course | |
| int | $starttime | |
| int | $userid |
Definition at line 316 of file backup_cron_helper.class.php.


| static remove_deleted_courses_from_schedule | ( | ) | [static] |
Removes deleted courses fromn the backup_courses table so that we don't waste time backing them up.
moodle_database $DB
Definition at line 386 of file backup_cron_helper.class.php.

| static remove_excess_backups | ( | $ | course | ) | [static] |
Removes excess backups from the external system and the local file system.
The number of backups keep comes from $config->backup_auto_keep
| stdClass | $course |
Definition at line 457 of file backup_cron_helper.class.php.


| static run_automated_backup | ( | $ | rundirective = self::RUN_ON_SCHEDULE | ) | [static] |
Runs the automated backups if required
moodle_database $DB
Definition at line 64 of file backup_cron_helper.class.php.


| static set_state_running | ( | $ | running = true | ) | [static] |
Sets the state of the automated backup system.
| bool | $running |
Definition at line 437 of file backup_cron_helper.class.php.


| const AUTO_BACKUP_DISABLED = 0 |
Definition at line 55 of file backup_cron_helper.class.php.
| const AUTO_BACKUP_ENABLED = 1 |
Definition at line 56 of file backup_cron_helper.class.php.
| const AUTO_BACKUP_MANUAL = 2 |
Definition at line 57 of file backup_cron_helper.class.php.
| const BACKUP_STATUS_ERROR = 0 |
Course automated backup errored
Definition at line 44 of file backup_cron_helper.class.php.
| const BACKUP_STATUS_OK = 1 |
Course automated backup completed successfully
Definition at line 42 of file backup_cron_helper.class.php.
| const BACKUP_STATUS_SKIPPED = 3 |
Course automated backup was skipped
Definition at line 48 of file backup_cron_helper.class.php.
| const BACKUP_STATUS_UNFINISHED = 2 |
Course automated backup never finished
Definition at line 46 of file backup_cron_helper.class.php.
| const RUN_IMMEDIATELY = 1 |
Run immediately.
Definition at line 53 of file backup_cron_helper.class.php.
| const RUN_ON_SCHEDULE = 0 |
Run if required by the schedule set in config. Default.
Definition at line 51 of file backup_cron_helper.class.php.
| const STATE_DISABLED = 1 |
automated backups are disabled and will not be run
Definition at line 37 of file backup_cron_helper.class.php.
| const STATE_OK = 0 |
automated backups are active and ready to run
Definition at line 35 of file backup_cron_helper.class.php.
| const STATE_RUNNING = 2 |
automated backups are all ready running!
Definition at line 39 of file backup_cron_helper.class.php.