Moodle  2.2.1
http://www.collinsharper.com
backup_cron_automated_helper Class Reference

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

Detailed Description

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.


Member Function Documentation

static calculate_next_automated_backup ( timezone,
now 
) [static]

Works out the next time the automated backup should be run.

Parameters:
mixed$timezone
int$now
Returns:
int

Definition at line 277 of file backup_cron_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static get_automated_backup_state ( rundirective = self::RUN_ON_SCHEDULE) [static]

Gets the state of the automated backup system.

moodle_database $DB

Returns:
int One of self::STATE_*

Definition at line 406 of file backup_cron_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
array

Definition at line 248 of file backup_cron_helper.class.php.

Here is the caller graph for this function:

static launch_automated_backup ( course,
starttime,
userid 
) [static]

Launches a automated backup routine for the given course

Parameters:
stdClass$course
int$starttime
int$userid
Returns:
bool

Definition at line 316 of file backup_cron_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Removes deleted courses fromn the backup_courses table so that we don't waste time backing them up.

moodle_database $DB

Returns:
int

Definition at line 386 of file backup_cron_helper.class.php.

Here is the caller graph for this function:

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

Parameters:
stdClass$course
Returns:
bool

Definition at line 457 of file backup_cron_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

static set_state_running ( running = true) [static]

Sets the state of the automated backup system.

Parameters:
bool$running
Returns:
bool

Definition at line 437 of file backup_cron_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

Definition at line 55 of file backup_cron_helper.class.php.

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.

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.

Course automated backup was skipped

Definition at line 48 of file backup_cron_helper.class.php.

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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations