Base abstract class for all the helper classes providing various operations.
More...
|
static | check_and_create_backup_dir ($backupid) |
| Given one backupid, create all the needed dirs to have one backup temp dir available.
|
|
static | clear_backup_dir ($backupid, core\progress\base $progress=null) |
| Given one backupid, ensure its temp dir is completely empty.
|
|
static | delete_backup_dir ($backupid, core\progress\base $progress=null) |
| Given one backupid, delete completely its temp dir.
|
|
static | delete_dir_contents ($dir, $excludeddir='', core\progress\base $progress=null) |
| Given one fullpath to directory, delete its contents recursively Copied originally from somewhere in the net.
|
|
static | delete_old_backup_dirs ($deletebefore, core\progress\base $progress=null) |
| Delete all the temp dirs older than the time specified.
|
|
static | get_inforef_itemnames () |
| This function returns one array of itemnames that are being handled by inforef.xml files.
|
|
static | is_sqlparam ($value) |
| This function simply marks one param to be considered as straight sql param, so it won't be searched in the structure tree nor converted at all.
|
|
static | log ($message, $level, $a, $depth, $display, $logger) |
| This function will be invoked by any log() method in backup/restore, acting as a simple forwarder to the standard loggers but also, if the $display parameter is true, supporting translation via get_string() and sending to standard output.
|
|
static | store_backup_file ($backupid, $filepath, core\progress\base $progress=null) |
| Given one backupid and the (FS) final generated file, perform its final storage into Moodle file storage.
|
|
Base abstract class for all the helper classes providing various operations.
TODO: Finish phpdocs
◆ clear_backup_dir()
Given one backupid, ensure its temp dir is completely empty.
If supplied, progress object should be ready to receive indeterminate progress reports.
- Parameters
-
◆ delete_backup_dir()
static backup_helper::delete_backup_dir |
( |
| $backupid, |
|
|
core\progress\base | $progress = null ) |
|
static |
Given one backupid, delete completely its temp dir.
If supplied, progress object should be ready to receive indeterminate progress reports.
- Parameters
-
◆ delete_dir_contents()
static backup_helper::delete_dir_contents |
( |
| $dir, |
|
|
| $excludeddir = '', |
|
|
core\progress\base | $progress = null ) |
|
static |
Given one fullpath to directory, delete its contents recursively Copied originally from somewhere in the net.
TODO: Modernise this
If supplied, progress object should be ready to receive indeterminate progress reports.
- Parameters
-
string | $dir | Directory to delete |
string | $excludedir | Exclude this directory |
core\progress\base | $progress | Optional progress reporting object |
◆ delete_old_backup_dirs()
static backup_helper::delete_old_backup_dirs |
( |
| $deletebefore, |
|
|
core\progress\base | $progress = null ) |
|
static |
Delete all the temp dirs older than the time specified.
If supplied, progress object should be ready to receive indeterminate progress reports.
- Parameters
-
int | $deletebefore | Delete files and directories older than this time |
core\progress\base | $progress | Optional progress reporting object |
◆ get_inforef_itemnames()
static backup_helper::get_inforef_itemnames |
( |
| ) |
|
|
static |
This function returns one array of itemnames that are being handled by inforef.xml files.
Used both by backup and restore
◆ is_sqlparam()
static backup_helper::is_sqlparam |
( |
| $value | ) |
|
|
static |
This function simply marks one param to be considered as straight sql param, so it won't be searched in the structure tree nor converted at all.
Useful for better integration of definition of sources in structure and DB stuff
◆ store_backup_file()
static backup_helper::store_backup_file |
( |
| $backupid, |
|
|
| $filepath, |
|
|
core\progress\base | $progress = null ) |
|
static |
Given one backupid and the (FS) final generated file, perform its final storage into Moodle file storage.
For stored files it returns the complete file_info object
Note: the $filepath is deleted if the backup file is created successfully
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
-
int | $backupid | |
string | $filepath | zip file containing the backup |
core\progress\base | $progress | Optional progress monitor |
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- backup/util/helper/backup_helper.class.php