Non instantiable helper class providing DB support to the @backup_controller.
More...
|
static | apply_config_defaults (backup_controller $controller) |
| Sets the default values for the settings in a backup operation. More...
|
|
static | apply_version_and_release () |
| Update CFG->backup_version and CFG->backup_release if change in version is detected.
|
|
static | backup_get_original_course_info ($courseid) |
| Given the courseid, return some course related information we want to transport. More...
|
|
static | backup_includes_file_references ($backupid) |
| Given the backupid, detect if the backup contains references to external contents. More...
|
|
static | backup_includes_files ($backupid) |
| Given the backupid, determine whether this backup should include files from the moodle file storage system. More...
|
|
static | backup_includes_mnet_remote_users ($backupid) |
| Given the backupid, detect if the backup includes "mnet" remote users or no.
|
|
static | create_backup_files_temp_table ($backupid) |
|
static | create_backup_ids_temp_table ($backupid) |
|
static | decode_backup_temp_info ($info) |
| Decode the info field from backup_ids_temp or backup_files_temp. More...
|
|
static | drop_backup_ids_temp_table ($backupid) |
|
static | encode_backup_temp_info ($info) |
| Encode the info field for backup_ids_temp or backup_files_temp. More...
|
|
static | get_courseid_from_type_id ($type, $id) |
| Given one type and id from controller, return the corresponding courseid.
|
|
static | get_moodle_backup_information ($backupid, core\progress\base $progress=null) |
| Get details information for main moodle_backup.xml file, extracting it from the specified controller. More...
|
|
static | get_progress ($backupid) |
| Get the progress details of a backup operation. More...
|
|
static | load_controller ($backupid) |
|
static | save_controller ($controller, $checksum, $includeobj=true, $cleanobj=false) |
| Send one backup controller to DB. More...
|
|
Non instantiable helper class providing DB support to the @backup_controller.
This class contains various static methods available for all the DB operations performed by the backup_controller class
TODO: Finish phpdocs
◆ apply_config_defaults()
static backup_controller_dbops::apply_config_defaults |
( |
backup_controller |
$controller | ) |
|
|
static |
Sets the default values for the settings in a backup operation.
Based on the mode of the backup it will load proper defaults using apply_admin_config_defaults.
- Parameters
-
◆ backup_get_original_course_info()
static backup_controller_dbops::backup_get_original_course_info |
( |
|
$courseid | ) |
|
|
static |
Given the courseid, return some course related information we want to transport.
- Parameters
-
int | $course | the id of the course this backup belongs to |
◆ backup_includes_file_references()
static backup_controller_dbops::backup_includes_file_references |
( |
|
$backupid | ) |
|
|
static |
Given the backupid, detect if the backup contains references to external contents.
- Copyright
- 2012 Dongsheng Cai http://dongsheng.org
- Return values
-
◆ backup_includes_files()
static backup_controller_dbops::backup_includes_files |
( |
|
$backupid | ) |
|
|
static |
Given the backupid, determine whether this backup should include files from the moodle file storage system.
- Parameters
-
string | $backupid | The ID of the backup. |
- Return values
-
int | Indicates whether files should be included in backups. |
◆ decode_backup_temp_info()
static backup_controller_dbops::decode_backup_temp_info |
( |
|
$info | ) |
|
|
static |
Decode the info field from backup_ids_temp or backup_files_temp.
- Parameters
-
mixed | $info | The info field data to decode, may be an object or a simple integer. |
- Return values
-
mixed | The decoded information. For simple types it returns, for complex ones we decode. |
◆ encode_backup_temp_info()
static backup_controller_dbops::encode_backup_temp_info |
( |
|
$info | ) |
|
|
static |
Encode the info field for backup_ids_temp or backup_files_temp.
- Parameters
-
mixed | $info | string The info field data to encode. |
- Return values
-
string | An encoded string of data or null if the input is null. |
◆ get_moodle_backup_information()
static backup_controller_dbops::get_moodle_backup_information |
( |
|
$backupid, |
|
|
core\progress\base |
$progress = null |
|
) |
| |
|
static |
Get details information for main moodle_backup.xml file, extracting it from the specified controller.
If you specify the progress monitor, this will start a new progress section to track progress in processing (in case this task takes a long time).
- Parameters
-
string | $backupid | Backup ID |
core\progress\base | $progress | Optional progress monitor |
◆ get_progress()
static backup_controller_dbops::get_progress |
( |
|
$backupid | ) |
|
|
static |
Get the progress details of a backup operation.
Get backup records directly from database, if the backup has successfully completed there will be no controller object to load.
- Parameters
-
string | $backupid | The backup id to query. |
- Return values
-
array::$progress | The backup progress details. |
◆ save_controller()
static backup_controller_dbops::save_controller |
( |
|
$controller, |
|
|
|
$checksum, |
|
|
|
$includeobj = true , |
|
|
|
$cleanobj = false |
|
) |
| |
|
static |
Send one backup controller to DB.
- Parameters
-
backup_controller | $controller | controller to send to DB |
string | $checksum | hash of the controller to be checked |
bool | $includeobj | to decide if the object itself must be updated (true) or no (false) |
bool | $cleanobj | to decide if the object itself must be cleaned (true) or no (false) |
- Return values
-
int | id of the controller record in the DB |
- Exceptions
-
backup_controller_exception|backup_dbops_exception | |
The documentation for this class was generated from the following file: