Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Non instantiable helper class providing DB support to the @backup_controller. More...
Static Public Member Functions | |
static | apply_config_defaults (backup_controller $controller) |
Sets the default values for the settings in a backup operation. | |
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. | |
static | backup_includes_file_references ($backupid) |
Given the backupid, detect if the backup contains references to external contents. | |
static | backup_includes_files ($backupid) |
Given the backupid, determine whether this backup should include files from the moodle file storage system. | |
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 | create_question_category_temp_tables () |
Create temporary tables to store a partial copies of question category data from the backup_ids_temp table. | |
static | decode_backup_temp_info ($info) |
Decode the info field from backup_ids_temp or backup_files_temp. | |
static | drop_backup_ids_temp_table ($backupid) |
static | drop_question_category_temp_tables () |
Dispose of the additional temporary tables. | |
static | encode_backup_temp_info ($info) |
Encode the info field for backup_ids_temp or backup_files_temp. | |
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. | |
static | get_progress ($backupid) |
Get the progress details of a backup operation. | |
static | load_controller ($backupid) |
static | save_controller ($controller, $checksum, $includeobj=true, $cleanobj=false) |
Send one backup controller to DB. | |
Static Protected Attributes | |
static int | $includesfilescache |
Cached backup_includes_files result. | |
static string | $includesfilescachebackupid |
Backup id for cached backup_includes_files result. | |
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
|
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.
backup_controller | $controller |
|
static |
Given the courseid, return some course related information we want to transport.
int | $course | the id of the course this backup belongs to |
|
static |
|
static |
Given the backupid, determine whether this backup should include files from the moodle file storage system.
string | $backupid | The ID of the backup. |
int | Indicates whether files should be included in backups. |
|
static |
Create temporary tables to store a partial copies of question category data from the backup_ids_temp table.
This is to work around MySQL's restruction on joining the same temporary table multiple times in the same query. It isn't necessary on PostgreSQL (which can join temporary tables multiple times) or MSSQL (which doesn't really use temporary tables) but doing it this way keeps things database-agnostic.
|
static |
Decode the info field from backup_ids_temp or backup_files_temp.
mixed | $info | The info field data to decode, may be an object or a simple integer. |
mixed | The decoded information. For simple types it returns, for complex ones we decode. |
|
static |
Encode the info field for backup_ids_temp or backup_files_temp.
mixed | $info | string The info field data to encode. |
string | An encoded string of data or null if the input is 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).
string | $backupid | Backup ID |
core\progress\base | $progress | Optional progress monitor |
|
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.
string | $backupid | The backup id to query. |
array#$progress | The backup progress details. |
|
static |
Send one backup controller to DB.
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) |
int | id of the controller record in the DB |
backup_controller_exception|backup_dbops_exception |