Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
restore_step Class Reference

Abstract class defining the needed stuf for one restore step. More...

Inheritance diagram for restore_step:
base_step executable loggable restore_execution_step restore_structure_step restore_course_legacy_files_step restore_create_and_clean_temp_stuff restore_create_included_users restore_create_question_files restore_decode_interlinks restore_default_enrolments_step restore_drop_and_clean_temp_stuff restore_execute_after_restore restore_fix_restorer_access_step restore_load_and_map_roles restore_load_categories_and_questions restore_load_included_inforef_records restore_load_included_users restore_move_module_questions_categories restore_process_categories_and_questions restore_process_course_modules_availability restore_process_file_aliases_queue restore_process_included_users restore_rebuild_course_cache restore_review_pending_block_positions restore_update_availability restore_activity_competencies_structure_step restore_activity_grade_history_structure_step restore_activity_grades_structure_step restore_activity_grading_structure_step restore_activity_structure_step restore_badges_structure_step restore_block_instance_structure_step restore_calendarevents_structure_step restore_comments_structure_step restore_contentbankcontent_structure_step restore_course_competencies_structure_step restore_course_completion_structure_step restore_course_loglastaccess_structure_step restore_course_logs_structure_step restore_course_logstores_structure_step restore_course_structure_step restore_create_categories_and_questions restore_enrolments_structure_step restore_filters_structure_step restore_grade_history_structure_step restore_gradebook_structure_step restore_groups_members_structure_step restore_groups_structure_step restore_load_included_files restore_module_structure_step restore_outcomes_structure_step restore_ras_and_caps_structure_step restore_rss_client_block_structure_step restore_scales_structure_step restore_section_structure_step restore_userscompletion_structure_step restore_xapistate_structure_step

Public Member Functions

 __construct ($name, $task=null)
 Constructor - instantiates one object of this class.
 
 apply_date_offset ($value)
 Apply course startdate offset based in original course startdate and course_offset_startdate setting Note we are using one static cache here, but by restoreid, so it's ok for concurrence/multiple executions in the same request.
 
 decrypt ($value)
 Returns symmetric-key AES-256 decryption of base64 encoded contents.
 
 destroy ()
 Destroy all circular references.
 
 execute ()
 This function will perform all the actions necessary to achieve the execution of the plan/part/task.
 
 get_name ()
 
 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_task ($task)
 

Protected Member Functions

 get_basepath ()
 
 get_courseid ()
 
 get_logger ()
 
 get_restoreid ()
 
 get_setting ($name)
 
 get_setting_value ($name)
 
 get_settings ()
 Protected API starts here.
 
 setting_exists ($name)
 

Protected Attributes

string $name
 One simple name for identification purposes.
 
base_task null $task
 Task this is part of.
 

Detailed Description

Abstract class defining the needed stuf for one restore step.

TODO: Finish phpdocs

Constructor & Destructor Documentation

◆ __construct()

restore_step::__construct ( $name,
$task = null )

Constructor - instantiates one object of this class.

Reimplemented from base_step.

Member Function Documentation

◆ apply_date_offset()

restore_step::apply_date_offset ( $value)

Apply course startdate offset based in original course startdate and course_offset_startdate setting Note we are using one static cache here, but by restoreid, so it's ok for concurrence/multiple executions in the same request.

Note: The policy is to roll date only for configurations and not for user data. see MDL-9367.

Parameters
int$valueTime value (seconds since epoch), or empty for nothing
Return values
intTime value after applying the date offset, or empty for nothing

◆ decrypt()

restore_step::decrypt ( $value)

Returns symmetric-key AES-256 decryption of base64 encoded contents.

This method is used in restore operations to decrypt contents encrypted with encrypted_final_element automatically decoding (base64) and decrypting contents using the key stored in backup_encryptkey config.

Requires openssl, cipher availability, and key existence (backup automatically sets it if missing). Integrity is provided via HMAC.

Parameters
string$valueencrypted_final_element value to decode and decrypt.
Return values
string|nulldecoded and decrypted value or null if the operation can not be performed.

◆ destroy()

base_step::destroy ( )
inherited

Destroy all circular references.

It helps PHP 5.2 a lot!

◆ execute()

executable::execute ( )
inherited

This function will perform all the actions necessary to achieve the execution of the plan/part/task.

Implemented in backup_activity_task, backup_execution_step, backup_plan, backup_section_task, backup_structure_step, base_plan, base_task, restore_activity_task, restore_execution_step, restore_plan, restore_section_task, and restore_structure_step.

◆ log()

base_step::log ( $message,
$level,
$a = null,
$depth = null,
$display = false )
inherited

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.


The documentation for this class was generated from the following file: