Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Implementable class defining the needed stuf for one restore plan. More...
Public Member Functions | |
__construct ($controller) | |
Constructor - instantiates one object of this class. | |
add_result ($result) | |
Add the passed info to the plan results. | |
add_task ($task) | |
backup_release_compare (string $release, string $operator) | |
Compares the provided moodle release with the one the backup was taken from. | |
backup_version_compare (int $version, string $operator) | |
Compares the provided moodle version with the one the backup was taken from. | |
build () | |
Function responsible for building the tasks of any plan with their corresponding settings (must set the $built property to true) | |
calculate_checksum () | |
This function will return one unique and stable checksum for one instance of the class implementing it. | |
debug_display_all_settings_values () | |
For debug only. | |
destroy () | |
Destroy all circular references. | |
execute () | |
Function responsible for executing the tasks of any plan. | |
execute_after_restore () | |
Execute the after_restore methods of all the executed tasks in the plan. | |
get_basepath () | |
get_courseid () | |
get_decoder () | |
get_info () | |
get_logger () | |
get_mode () | |
get_name () | |
get_preloaded_information () | |
get_progress () | |
Gets the progress reporter, which can be used to report progress within the backup or restore process. | |
get_restoreid () | |
get_results () | |
Return the results collected via self::add_result() method. | |
get_setting ($name) | |
return one setting by name, useful to request root/course settings that are, by definition, unique by name. | |
get_settings () | |
get_target () | |
get_tasks () | |
get_tempdir () | |
get_userid () | |
is_checksum_correct ($checksum) | |
Given one checksum, returns if matches object's checksum (true) or no (false) | |
is_excluding_activities () | |
is_missing_modules () | |
is_samesite () | |
log ($message, $level, $a=null, $depth=null, $display=false) | |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed. | |
set_excluding_activities () | |
set_missing_modules () | |
set_preloaded_information () | |
setting_exists ($name) | |
Wrapper over @get_setting() that returns if the requested setting exists or no. | |
Protected Attributes | |
$basepath | |
$built | |
restore_controller | $controller |
$decoder | |
$excludingdactivities | |
$missingmodules | |
$name | |
$preloaded | |
$results | |
$settings | |
$tasks | |
Implementable class defining the needed stuf for one restore plan.
TODO: Finish phpdocs
restore_plan::__construct | ( | $controller | ) |
Constructor - instantiates one object of this class.
Reimplemented from base_plan.
|
inherited |
Add the passed info to the plan results.
At the moment we expect an associative array structure to be merged into the current results. In the future, some sort of base_result class may be introduced.
array | $result | associative array describing a result of a task/step |
restore_plan::backup_release_compare | ( | string | $release, |
string | $operator ) |
Compares the provided moodle release with the one the backup was taken from.
string | $release | Moodle release (X.Y or X.Y.Z) |
string | $operator | Operator to compare the provided release to the backup release. { |
bool | True if the comparison passes. |
restore_plan::backup_version_compare | ( | int | $version, |
string | $operator ) |
Compares the provided moodle version with the one the backup was taken from.
int | $version | Moodle version number (YYYYMMDD or YYYYMMDDXX) |
string | $operator | Operator to compare the provided version to the backup version. { |
bool | True if the comparison passes. |
restore_plan::build | ( | ) |
Function responsible for building the tasks of any plan with their corresponding settings (must set the $built property to true)
Reimplemented from base_plan.
|
inherited |
This function will return one unique and stable checksum for one instance of the class implementing it.
It's each implementation responsibility to do it recursively if needed and use optional store (caching) of the checksum if necessary/possible
Implements checksumable.
|
inherited |
For debug only.
Get a simple test display of all the settings.
string |
restore_plan::destroy | ( | ) |
restore_plan::execute | ( | ) |
Function responsible for executing the tasks of any plan.
Reimplemented from base_plan.
restore_plan::get_progress | ( | ) |
Gets the progress reporter, which can be used to report progress within the backup or restore process.
core\progress\base | Progress reporting object |
Reimplemented from base_plan.
|
inherited |
Return the results collected via self::add_result() method.
array |
|
inherited |
return one setting by name, useful to request root/course settings that are, by definition, unique by name.
string | $name | name of the setting |
base_setting |
base_plan_exception | if setting name is not found. |
|
inherited |
Given one checksum, returns if matches object's checksum (true) or no (false)
Implements checksumable.
restore_plan::log | ( | $message, | |
$level, | |||
$a = null, | |||
$depth = null, | |||
$display = false ) |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed.
Implements loggable.