Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Files | Namespaces | Classes | Functions | Variables
core_backup

Files

file  backup_activity_task.class.php
 Defines backup_activity_task class.
 
file  backup_block_task.class.php
 @subpackage moodle2
 
file  backup_course_task.class.php
 Defines backup_course_task.
 
file  backup_coursereport_plugin.class.php
 Base class for course report backup plugins.
 
file  backup_custom_fields.php
 Defines various element classes used in specific areas.
 
file  backup_default_block_task.class.php
 Defines backup_default_block_task class.
 
file  backup_enrol_plugin.class.php
 Defines backup_enrol_plugin class.
 
file  backup_final_task.class.php
 Defines backup_final_task class.
 
file  backup_format_plugin.class.php
 Defines backup_format_plugin class.
 
file  backup_gradingform_plugin.class.php
 Contains class backup_gradingform_plugin responsible for advanced grading form plugin backup.
 
file  backup_local_plugin.class.php
 Defines backup_local_plugin class.
 
file  backup_moodleform.class.php
 This file contains the generic moodleform bridge for the backup user interface as well as the individual forms that relate to the different stages the user interface can exist within.
 
file  backup_plagiarism_plugin.class.php
 Defines backup_plagiarism_plugin class.
 
file  backup_plan_builder.class.php
 Defines backup_plan_builder class.
 
file  backup_plugin.class.php
 Defines backup_plugin class.
 
file  backup_qtype_extrafields_plugin.class.php
 Defines backup_qtype_extrafields_plugin class.
 
file  backup_qtype_plugin.class.php
 Defines backup_qtype_plugin class.
 
file  backup_report_plugin.class.php
 Base class for report backup plugins.
 
file  backup_root_task.class.php
 Defines backup_root_task class.
 
file  backup_section_task.class.php
 Defines backup_section_task class.
 
file  backup_setting.class.php
 Defines backup_setting class.
 
file  backup_settingslib.php
 Defines classes used to handle backup settings.
 
file  backup_stepslib.php
 Defines various backup steps that will be used by common tasks in backup.
 
file  backup_subplugin.class.php
 Defines backup_subplugin class.
 
file  backup_theme_plugin.class.php
 Defines backup_theme_plugin class.
 
file  backup_tool_plugin.class.php
 Admin tool backup plugin base.
 
file  backup_ui.class.php
 This file contains the backup user interface class.
 
file  backup_ui_setting.class.php
 This file contains the setting user interface classes that all backup/restore settings use to represent the UI they have.
 
file  backup_ui_stage.class.php
 Backup user interface stages.
 
file  backup_xml_transformer.class.php
 Defines backup_xml_transformer class.
 
file  base_controller.class.php
 Base class with shared stuff between backup controller and restore controller.
 
file  base_moodleform.class.php
 This file contains the generic moodleform bridge for the backup user interface as well as the individual forms that relate to the different stages the user interface can exist within.
 
file  base_ui.class.php
 This file contains the backup user interface class.
 
file  base_ui_stage.class.php
 Backup user interface stages.
 
file  behat_backup.php
 Backup and restore actions to help behat feature files writting.
 
file  core_backup_html_logger.class.php
 Logger that stores HTML log data in memory, ready for later display.
 
file  externallib.php
 External backup API.
 
file  import_extensions.php
 This file contains extension of the backup classes that override some methods and functionality in order to customise the backup UI for the purposes of import.
 
file  provider.php
 Privacy Subsystem implementation for core_backup.
 
file  renderer.php
 This file contains backup and restore output renderers.
 
file  restore_activity_task.class.php
 Defines restore_activity_task class.
 
file  restore_block_task.class.php
 Defines restore_block_task class.
 
file  restore_course_task.class.php
 Defines restore_course_task class.
 
file  restore_coursereport_plugin.class.php
 Restore for course plugin: course report.
 
file  restore_default_block_task.class.php
 Defines restore_default_block_task class.
 
file  restore_enrol_plugin.class.php
 Defines restore_enrol_plugin class.
 
file  restore_final_task.class.php
 Defines restore_final_task class.
 
file  restore_format_plugin.class.php
 Defines restore_format_plugin class.
 
file  restore_gradingform_plugin.class.php
 Contains class restore_gradingform_plugin responsible for advanced grading form plugin backup.
 
file  restore_local_plugin.class.php
 Defines restore_local_plugin class.
 
file  restore_moodleform.class.php
 This file contains the forms used by the restore stages.
 
file  restore_plagiarism_plugin.class.php
 Defines restore_plagiarism_plugin class.
 
file  restore_plan_builder.class.php
 Defines restore_plan_builder class.
 
file  restore_plugin.class.php
 Defines restore_plugin class.
 
file  restore_qtype_extrafields_plugin.class.php
 Defines restore_qtype_extrafields_plugin class.
 
file  restore_qtype_plugin.class.php
 Defines restore_qtype_plugin class.
 
file  restore_report_plugin.class.php
 Restore for plugin report.
 
file  restore_root_task.class.php
 Defines restore_root_task class.
 
file  restore_section_task.class.php
 Defines restore_section_task class.
 
file  restore_settingslib.php
 Defines classes used to handle restore settings.
 
file  restore_stepslib.php
 Defines various restore steps that will be used by common tasks in restore.
 
file  restore_subplugin.class.php
 Defines restore_subplugin class.
 
file  restore_theme_plugin.class.php
 Restore for course plugin: theme.
 
file  restore_tool_plugin.class.php
 Admin tool restore plugin base.
 
file  restore_ui.class.php
 This file contains the restore user interface class.
 
file  restore_ui_components.php
 This file contains components used by the restore UI.
 
file  restore_ui_stage.class.php
 restore user interface stages
 
file  root_backup_setting.class.php
 Defines root_backup_setting class.
 

Namespaces

 core_backup\privacy
  
 

Classes

class  anonymizer_final_element
 Implementation of backup_final_element that provides one interceptor for anonymization of data. More...
 
class  backup_activities_setting
 root setting to control if backup will include activities or no. More...
 
class  backup_activity_generic_setting
 generic activity setting to pass various settings between tasks and steps More...
 
class  backup_activity_included_setting
 activity backup setting to control if activity will be included or no, depends of @backup_activities_setting and optionally parent section included setting More...
 
class  backup_activity_structure_step
 Abstract structure step, parent of all the activity structure steps. More...
 
class  backup_activity_task
 Provides all the settings and steps to perform one complete backup of the activity. More...
 
class  backup_activity_userinfo_setting
 activity backup setting to control if activity will include user information or no, depends of @backup_users_setting More...
 
class  backup_anonymize_setting
 root setting to control if backup will generate anonymized user info or no, depends of @backup_users_setting so only is available if the former is enabled (apart from security that can change it More...
 
class  backup_badges_setting
 root setting to control if backup will include badges or not, depends on @backup_activities_setting More...
 
class  backup_block_task
 abstract block task that provides all the properties and common steps to be performed when one block is being backup More...
 
class  backup_calendarevents_setting
 root setting to control if backup will include calender events or no (any level), depends of @backup_users_setting exactly in the same way than @backup_anonymize_setting so we extend from it More...
 
class  backup_comments_setting
 root setting to control if backup will include comments or no (any level), depends of @backup_users_setting exactly in the same way than @backup_anonymize_setting so we extend from it More...
 
class  backup_competencies_setting
 root setting to control if backup will include competencies or not. More...
 
class  backup_confirmation_form
 Confirmation backup user interface stage moodleform. More...
 
class  backup_course_task
 course task that provides all the properties and common steps to be performed when one course is being backup More...
 
class  backup_coursereport_plugin
 
class  backup_customfield_setting
 root setting to control if backup will include custom field information More...
 
class  backup_default_block_task
 Default block task to backup blocks that haven't own DB structures to be added when one block is being backup. More...
 
class  backup_enrol_plugin
 Base class for enrol backup plugins. More...
 
class  backup_filename_setting
 root setting to handle backup file names (no dependencies nor anything else) More...
 
class  backup_files_viewer
 Data structure representing backup files viewer. More...
 
class  backup_final_task
 Final task that provides all the final steps necessary in order to finish one backup (mainly gathering references and creating the main xml) apart from some final cleaning. More...
 
class  backup_format_plugin
 Class extending standard backup_plugin in order to implement some helper methods related with the course formats (format plugin) More...
 
class  backup_generic_setting
 root generic setting to store different things without dependencies More...
 
class  backup_gradingform_plugin
 
class  backup_groups_setting
 root setting to control if backup will include group information depends on @backup_users_setting More...
 
class  backup_initial_form
 Initial backup user interface stage moodleform. More...
 
class  backup_local_plugin
 Class extending standard backup_plugin in order to implement some helper methods related with the local plugins. More...
 
class  backup_logs_setting
 root setting to control if backup will include logs or no (any level), depends of @backup_users_setting exactly in the same way than @backup_anonymize_setting so we extend from it More...
 
class  backup_moodleform
 Backup moodleform bridge. More...
 
class  backup_plagiarism_plugin
 Class extending standard backup_plugin in order to implement some helper methods related with the plagiarism plugins (plagiarism plugin) More...
 
class  backup_plan_builder
 Abstract class defining the static method in charge of building the whole backup plan, based in @backup_controller preferences. More...
 
class  backup_plugin
 Class implementing the plugins support for moodle2 backups. More...
 
class  backup_plugin_element
 Implementation of backup_optigroup_element to be used by plugins stuff. More...
 
class  backup_qtype_extrafields_plugin
 Class extending backup_qtype_plugin in order to use extra fields method. More...
 
class  backup_qtype_plugin
 Class extending standard backup_plugin in order to implement some helper methods related with the questions (qtype plugin) More...
 
class  backup_report_plugin
 
class  backup_role_assignments_setting
 root setting to control if backup will include role assignments or no (any level), depends of @backup_users_setting exactly in the same way than @backup_anonymize_setting so we extend from it More...
 
class  backup_root_task
 Start task that provides all the settings common to all backups and some initialization steps. More...
 
class  backup_schema_form
 Schema backup user interface stage moodleform. More...
 
class  backup_section_generic_setting
 generic section setting to pass various settings between tasks and steps More...
 
class  backup_section_included_setting
 Setting to define if one section is included or no. More...
 
class  backup_section_task
 section task that provides all the properties and common steps to be performed when one section is being backup More...
 
class  backup_section_userinfo_setting
 section backup setting to control if section will include user information or no, depends of @backup_users_setting More...
 
class  backup_setting
 Parent class for all backup settings. More...
 
class  backup_setting_exception
 Exception class used by all the @backup_setting stuff. More...
 
class  backup_setting_ui
 Abstract class to represent the user interface backup settings have. More...
 
class  backup_setting_ui_checkbox
 A checkbox user interface element for backup settings (default) More...
 
class  backup_setting_ui_dateselector
 A date selector user interface widget for backup settings. More...
 
class  backup_setting_ui_defaultcustom
 A wrapper for defaultcustom form element - can have either text or date_selector type. More...
 
class  backup_setting_ui_exception
 Backup setting UI exception class. More...
 
class  backup_setting_ui_radio
 Radio button user interface element for backup settings. More...
 
class  backup_setting_ui_select
 A select box, drop down user interface for backup settings. More...
 
class  backup_setting_ui_text
 A text input user interface element for backup settings. More...
 
class  backup_subplugin
 Class implementing the subplugins support for moodle2 backups. More...
 
class  backup_subplugin_element
 Implementation of backup_optigroup_element to be used by subplugins stuff. More...
 
class  backup_theme_plugin
 Base class for theme backup plugins. More...
 
class  backup_tool_plugin
 Admin tool backup plugin base class. More...
 
class  backup_ui
 This is the backup user interface class. More...
 
class  backup_ui_exception
 Backup user interface exception. More...
 
class  backup_ui_stage
 Abstract stage class. More...
 
class  backup_ui_stage_complete
 The completed backup stage. More...
 
class  backup_ui_stage_confirmation
 Confirmation stage. More...
 
class  backup_ui_stage_final
 Final stage of backup. More...
 
class  backup_ui_stage_initial
 Class representing the initial stage of a backup. More...
 
class  backup_ui_stage_schema
 Schema stage of backup process. More...
 
class  backup_users_setting
 root setting to control if backup will include user information A lot of other settings are dependent of this (module's user info, grades user info, messages, blogs... More...
 
class  backup_userscompletion_setting
 root setting to control if backup will include users completion data or no (any level), depends of @backup_users_setting exactly in the same way than @backup_anonymize_setting so we extend from it More...
 
class  backup_xml_transformer
 Class implementing the @xml_contenttransformed logic to be applied in moodle2 backups. More...
 
class  base64_encode_final_element
 Implementation of backup_final_element that provides base64 encoding. More...
 
class  base_controller
 
class  base_moodleform
 Base moodleform bridge. More...
 
class  base_setting_ui
 Abstract class used to represent the user interface that a setting has. More...
 
class  base_setting_ui_exception
 Base setting UI exception class. More...
 
class  base_ui
 This is the backup user interface class. More...
 
class  base_ui_exception
 Backup user interface exception. More...
 
class  base_ui_stage
 Abstract stage class. More...
 
class  behat_backup
 
class  core_backup\privacy\provider
 Privacy Subsystem implementation for core_backup. More...
 
class  core_backup_external
 
class  core_backup_html_logger
 
class  core_backup_renderer
 The primary renderer for the backup. More...
 
class  create_and_clean_temp_stuff
 Create the temp dir where backup/restore will happen and create temp ids table. More...
 
class  create_taskbasepath_directory
 Create the directory where all the task (activity/block...) information will be stored. More...
 
class  drop_and_clean_temp_stuff
 Delete the temp dir used by backup/restore (conditionally), delete old directories and drop temp ids table. More...
 
class  encrypted_final_element
 Implementation of backup_final_element that provides symmetric-key AES-256 encryption of contents. More...
 
class  file_nested_element
 Implementation of backup_nested_element that provides special handling of files. More...
 
class  import_course_search
 Extends the restore course search to search for import courses. More...
 
class  import_ui
 Import UI class. More...
 
class  import_ui_stage_confirmation
 Extends the confirmation stage. More...
 
class  import_ui_stage_final
 Overrides the final stage. More...
 
class  import_ui_stage_inital
 Extends the initial stage. More...
 
class  import_ui_stage_schema
 Extends the schema stage. More...
 
class  mnethosturl_final_element
 Implementation of backup_final_element that provides special handling of mnethosturl. More...
 
class  restore_activities_setting
 root setting to control if restore will create activities A lot of other settings (_included at activity levels) are dependent of this setting More...
 
class  restore_activity_competencies_structure_step
 Restore activity competencies structure step. More...
 
class  restore_activity_generic_setting
 generic activity setting to pass various settings between tasks and steps More...
 
class  restore_activity_grade_history_structure_step
 Step in charge of restoring the grade history of an activity. More...
 
class  restore_activity_grades_structure_step
 This structure step restores the grade items associated with one activity All the grade items are made child of the "course" grade item but the original categoryid is saved as parentitemid in the backup_ids table, so, when restoring the complete gradebook (categories and calculations), that information is available there. More...
 
class  restore_activity_grading_structure_step
 Defines the restore step for advanced grading methods attached to the activity module. More...
 
class  restore_activity_included_setting
 activity backup setting to control if activity will be included or no, depends of @restore_activities_setting and optionally parent section included setting More...
 
class  restore_activity_logs_structure_step
 This structure step restores activity logs, extending restore_course_logs_structure_step sharing its same structure but modifying the way records are handled. More...
 
class  restore_activity_logstores_structure_step
 Structure step in charge of restoring the logstores.xml file for the activity logs. More...
 
class  restore_activity_structure_step
 Abstract structure step, parent of all the activity structure steps. More...
 
class  restore_activity_task
 abstract activity task that provides all the properties and common tasks to be performed when one activity is being restored More...
 
class  restore_activity_userinfo_setting
 activity backup setting to control if activity will include user information or no, depends of @restore_users_setting More...
 
class  restore_badges_setting
 root setting to control if restore will create badges or not, depends on @restore_activities_setting More...
 
class  restore_badges_structure_step
 This structure steps restores the badges and their configs. More...
 
class  restore_block_instance_structure_step
 This structure steps restores one instance + positions of one block Note: Positions corresponding to one existing context are restored here, but all the ones having unknown contexts are sent to backup_ids for a later chance to be restored at the end (final task) More...
 
class  restore_block_task
 abstract block task that provides all the properties and common steps to be performed when one block is being restored More...
 
class  restore_calendarevents_setting
 root setting to control if restore will create events or no, depends of @restore_users_setting exactly in the same way than @restore_role_assignments_setting so we extend from it More...
 
class  restore_calendarevents_structure_step
 This structure steps restores the calendar events. More...
 
class  restore_category_search
 A category search component. More...
 
class  restore_comments_setting
 root setting to control if restore will create comments or no, depends of @restore_users_setting exactly in the same way than @restore_role_assignments_setting so we extend from it More...
 
class  restore_comments_structure_step
 This structure steps restores the comments Note: Cannot use the comments API because defaults to USER->id. More...
 
class  restore_competencies_setting
 root setting to control if competencies will also be restored. More...
 
class  restore_course_competencies_structure_step
 Restore course competencies structure step. More...
 
class  restore_course_completion_structure_step
 
class  restore_course_defaultcustom_setting
 Setting to switch between current and new course name/startdate. More...
 
class  restore_course_generic_setting
 generic course setting to pass various settings between tasks and steps More...
 
class  restore_course_generic_text_setting
 
class  restore_course_legacy_files_step
 Execution step that will migrate legacy files if present. More...
 
class  restore_course_logs_structure_step
 This structure step restores course logs (cmid = 0), delegating the hard work to the corresponding } passing the * collection of restore_log_rule rules to be observed as they are defined by the task. More...
 
class  restore_course_logstores_structure_step
 Structure step in charge of restoring the logstores.xml file for the course logs. More...
 
class  restore_course_overwrite_conf_setting
 Setting to define is we are going to overwrite course configuration. More...
 
class  restore_course_search
 A course search component. More...
 
class  restore_course_structure_step
 Structure step that will read the course.xml file, loading it and performing various actions depending of the site/restore settings. More...
 
class  restore_course_task
 course task that provides all the properties and common steps to be performed when one course is being restored More...
 
class  restore_coursereport_plugin
 
class  restore_create_and_clean_temp_stuff
 delete old directories and conditionally create backup_temp_ids table More...
 
class  restore_create_included_users
 Execution step that will create all the needed users as calculated by @restore_process_included_users (those having newiteind = 0) More...
 
class  restore_customfield_setting
 root setting to control if restore will include custom field information More...
 
class  restore_decode_interlinks
 decode all the interlinks present in restored content relying 100% in the restore_decode_processor that handles both the contents to modify and the rules to be applied More...
 
class  restore_default_block_task
 Default block task to restore blocks not having own DB structures to be added. More...
 
class  restore_default_enrolments_step
 If no instances yet add default enrol methods the same way as when creating new course in UI. More...
 
class  restore_drop_and_clean_temp_stuff
 delete the temp dir used by backup/restore (conditionally), delete old directories and drop temp ids table More...
 
class  restore_enrol_plugin
 Base class for enrol backup plugins. More...
 
class  restore_enrolments_structure_step
 This structure steps restores the enrol plugins and their underlying enrolments, performing all the mappings and/or movements required. More...
 
class  restore_execute_after_restore
 Review all the tasks having one after_restore method executing it to perform some final adjustments of information not available when the task was executed. More...
 
class  restore_filters_structure_step
 This structure steps restores the filters and their configs. More...
 
class  restore_final_task
 Final task that provides all the final steps necessary in order to finish one restore like gradebook, interlinks... More...
 
class  restore_fix_restorer_access_step
 Make sure the user restoring the course can actually access it. More...
 
class  restore_format_plugin
 Class extending standard restore_plugin in order to implement some helper methods related with the course formats (format plugin) More...
 
class  restore_generic_setting
 root generic setting to store different things without dependencies More...
 
class  restore_grade_histories_setting
 root setting to control if restore will create grade_histories or no, depends of @restore_users_setting exactly in the same way than @restore_role_assignments_setting so we extend from it More...
 
class  restore_grade_history_structure_step
 Step in charge of restoring the grade history of a course. More...
 
class  restore_gradebook_structure_step
 Restore calculated grade items, grade categories etc. More...
 
class  restore_gradingform_plugin
 
class  restore_groups_members_structure_step
 Structure step that will create all the needed group memberships by loading them from the groups.xml file performing the required matches. More...
 
class  restore_groups_setting
 root setting to control if restore will create groups/grouping information. More...
 
class  restore_groups_structure_step
 Structure step that will create all the needed groups and groupings by loading them from the groups.xml file performing the required matches. More...
 
class  restore_load_and_map_roles
 Execution step that, conditionally (if there isn't preloaded information), will load all the needed roles to backup_temp_ids. More...
 
class  restore_load_categories_and_questions
 Execution step that, conditionally (if there isn't preloaded information will load all the question categories and questions (header info only) to backup_temp_ids. More...
 
class  restore_load_included_files
 
class  restore_load_included_inforef_records
 
class  restore_load_included_users
 Execution step that, conditionally (if there isn't preloaded information and users have been selected in settings, will load all the needed users to backup_temp_ids. More...
 
class  restore_local_plugin
 Class extending standard restore_plugin in order to implement some helper methods related with local plugins. More...
 
class  restore_logs_setting
 root setting to control if restore will create logs or no, depends of @restore_users_setting exactly in the same way than @restore_role_assignments_setting so we extend from it More...
 
class  restore_module_structure_step
 Structure step to restore common course_module information. More...
 
class  restore_moodleform
 An abstract moodleform class specially designed for the restore forms. More...
 
class  restore_outcomes_structure_step
 Structure step that will create all the needed outocomes by loading them from the outcomes.xml. More...
 
class  restore_plagiarism_plugin
 Class extending standard restore_plugin in order to implement some helper methods related with the plagiarism plugins. More...
 
class  restore_plan_builder
 Abstract class defining the static method in charge of building the whole restore plan, based in @restore_controller preferences. More...
 
class  restore_plugin
 Class implementing the plugins support for moodle2 restore. More...
 
class  restore_process_categories_and_questions
 Execution step that, conditionally (if there isn't preloaded information) will process all the needed categories and questions in order to decide and perform any action with them (create / map / error) Note: Any error will cause exception, as far as this is the same processing than the one into restore prechecks (that should have stopped process earlier) More...
 
class  restore_process_course_modules_availability
 Process legacy module availability records in backup_ids. More...
 
class  restore_process_included_users
 Execution step that, conditionally (if there isn't preloaded information and users have been selected in settings, will process all the needed users in order to decide and perform any action with them (create / map / error) Note: Any error will cause exception, as far as this is the same processing than the one into restore prechecks (that should have stopped process earlier) More...
 
class  restore_qtype_extrafields_plugin
 Class extending restore_qtype_plugin in order to use extra fields method. More...
 
class  restore_qtype_plugin
 Class extending standard restore_plugin in order to implement some helper methods related with the questions (qtype plugin) More...
 
class  restore_ras_and_caps_structure_step
 
class  restore_rebuild_course_cache
 first, ensure that we have no gaps in section numbers and then, rebuid the course cache More...
 
class  restore_report_plugin
 
class  restore_review_form
 Restore complete process review form. More...
 
class  restore_review_pending_block_positions
 Review all the (pending) block positions in backup_ids, matching by contextid, creating positions as needed. More...
 
class  restore_role_assignments_setting
 root setting to control if restore will create role assignments or no (any level), depends of @restore_users_setting More...
 
class  restore_root_task
 Start task that provides all the settings common to all restores and other initial steps. More...
 
class  restore_scales_structure_step
 Structure step that will create all the needed scales by loading them from the scales.xml. More...
 
class  restore_schema_form
 Restore schema review form. More...
 
class  restore_search_base
 A base class that can be used to build a specific search upon. More...
 
class  restore_section_generic_setting
 generic section setting to pass various settings between tasks and steps More...
 
class  restore_section_included_setting
 Setting to define if one section is included or no. More...
 
class  restore_section_structure_step
 Structure step that will read the section.xml creating/updating sections as needed, rebuilding course cache and other friends. More...
 
class  restore_section_task
 section task that provides all the properties and common steps to be performed when one section is being restored More...
 
class  restore_section_userinfo_setting
 section backup setting to control if section will include user information or no, depends of @restore_users_setting More...
 
class  restore_settings_form
 Restore settings form. More...
 
class  restore_subplugin
 Class implementing the subplugins support for moodle2 restore. More...
 
class  restore_theme_plugin
 
class  restore_tool_plugin
 Admin tool restore plugin base class. More...
 
class  restore_ui
 This is the restore user interface class. More...
 
class  restore_ui_exception
 Restore user interface exception. More...
 
class  restore_ui_independent_stage
 Abstract class used to represent a restore stage that is indenependent. More...
 
class  restore_ui_stage
 Abstract stage class. More...
 
class  restore_ui_stage_complete
 This is the completed stage. More...
 
class  restore_ui_stage_confirm
 The confirmation stage. More...
 
class  restore_ui_stage_destination
 This is the destination stage. More...
 
class  restore_ui_stage_process
 Final stage of backup. More...
 
class  restore_ui_stage_review
 Confirmation stage. More...
 
class  restore_ui_stage_schema
 Schema stage of backup process. More...
 
class  restore_ui_stage_settings
 This stage is the settings stage. More...
 
class  restore_update_availability
 Updates the availability data for course modules and sections. More...
 
class  restore_users_setting
 root setting to control if restore will create user information A lot of other settings are dependent of this (module's user info, grades user info, messages, blogs... More...
 
class  restore_userscompletion_setting
 root setting to control if restore will create completion info or no, depends of @restore_users_setting exactly in the same way than @restore_role_assignments_setting so we extend from it More...
 
class  restore_userscompletion_structure_step
 Structure step that will process the user activity completion information if all these conditions are met: More...
 
class  root_backup_setting
 Abstract class containing all the common stuff for root backup settings. More...
 

Functions

 restore_gradebook_structure_step::after_execute ()
 put all activity grade items in the correct grade category and mark all for recalculation
 
 restore_groups_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_scales_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_outcomes_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_section_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_course_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_badges_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_calendarevents_structure_step::after_execute ()
 This method will be executed after the whole structure step have been processed. More...
 
 restore_activity_grading_structure_step::after_execute ()
 Final operations when the database records are inserted.
 
 restore_activity_grades_structure_step::after_restore ()
 This method will be executed after the rest of the restore has been processed. More...
 
 restore_module_structure_step::after_restore ()
 This method will be executed after the rest of the restore has been processed. More...
 
 restore_activity_structure_step::apply_activity_instance ($newitemid)
 This must be invoked immediately after creating the "module" activity record (forum, choice...) and will adjust the new activity id (the instance) in various places.
 
 restore_gradebook_structure_step::check_minmaxtouse ()
 Checks what should happen with the course grade setting minmaxtouse. More...
 
 create_and_clean_temp_stuff::define_execution ()
 Function that will contain all the code to be executed.
 
 drop_and_clean_temp_stuff::define_execution ()
 Function that will contain all the code to be executed.
 
 create_taskbasepath_directory::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_create_and_clean_temp_stuff::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_drop_and_clean_temp_stuff::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_decode_interlinks::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_rebuild_course_cache::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_execute_after_restore::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_review_pending_block_positions::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_update_availability::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_process_course_modules_availability::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_load_included_inforef_records::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_load_and_map_roles::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_load_included_users::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_process_included_users::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_create_included_users::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_load_categories_and_questions::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_process_categories_and_questions::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_course_legacy_files_step::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_default_enrolments_step::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_fix_restorer_access_step::define_execution ()
 Function that will contain all the code to be executed.
 
 restore_gradebook_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_grade_history_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_load_included_files::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_groups_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_groups_members_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_scales_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_outcomes_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_section_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_course_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_ras_and_caps_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_enrolments_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_filters_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_comments_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_badges_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_calendarevents_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_course_completion_structure_step::define_structure ()
 Define the course completion structure. More...
 
 restore_course_logs_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_course_logstores_structure_step::define_structure ()
 Return the elements to be processed on restore of logstores. More...
 
 restore_course_competencies_structure_step::define_structure ()
 Returns the structure. More...
 
 restore_activity_competencies_structure_step::define_structure ()
 Defines the structure. More...
 
 restore_activity_grading_structure_step::define_structure ()
 Declares paths in the grading.xml file we are interested in.
 
 restore_activity_grades_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_activity_grade_history_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_block_instance_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_module_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_userscompletion_structure_step::define_structure ()
 Function that will return the structure to be processed by this restore_step. More...
 
 restore_gradebook_structure_step::execute_condition ()
 To conditionally decide if this step must be executed Note the "settings" conditions are evaluated in the corresponding task. More...
 
 restore_grade_history_structure_step::execute_condition ()
 To conditionally decide if one step will be executed or no. More...
 
 restore_enrolments_structure_step::execute_condition ()
 Conditionally decide if this step should be executed. More...
 
 restore_badges_structure_step::execute_condition ()
 Conditionally decide if this step should be executed. More...
 
 restore_course_completion_structure_step::execute_condition ()
 Conditionally decide if this step should be executed. More...
 
 restore_course_logs_structure_step::execute_condition ()
 Conditionally decide if this step should be executed. More...
 
 restore_course_logstores_structure_step::execute_condition ()
 Conditionally decide if this step should be executed. More...
 
 restore_course_competencies_structure_step::execute_condition ()
 Execute conditions. More...
 
 restore_activity_competencies_structure_step::execute_condition ()
 Execute conditions. More...
 
 restore_activity_grading_structure_step::execute_condition ()
 This step is executed only if the grading file is present.
 
 restore_activity_grades_structure_step::execute_condition ()
 No grades in front page. More...
 
 restore_activity_grade_history_structure_step::execute_condition ()
 This step is executed only if the grade history file is present.
 
 restore_userscompletion_structure_step::execute_condition ()
 To conditionally decide if this step must be executed Note the "settings" conditions are evaluated in the corresponding task. More...
 
 restore_gradebook_structure_step::gradebook_calculation_freeze ()
 Freeze gradebook calculation if needed. More...
 
 backup_activity_structure_step::prepare_activity_structure ($activitystructure)
 Wraps any activity backup structure within the common 'activity' element that will include common to all activities information like id, context... More...
 
 restore_activity_structure_step::prepare_activity_structure ($paths)
 Adds support for the 'activity' path that is common to all the activities and will be processed globally here.
 
 restore_filters_structure_step::process_active ($data)
 
 restore_activity_structure_step::process_activity ($data)
 Process the activity path, informing the task about various ids, needed later.
 
 restore_badges_structure_step::process_alignment ($data)
 Link to an alignment for a badge. More...
 
 restore_course_structure_step::process_allowed_module ($data)
 
 restore_ras_and_caps_structure_step::process_assignment ($data)
 Assign roles. More...
 
 restore_gradebook_structure_step::process_attributes ($data)
 
 restore_section_structure_step::process_availability ($data)
 Process the legacy availability table record. More...
 
 restore_module_structure_step::process_availability ($data)
 Process the legacy availability table record. More...
 
 restore_section_structure_step::process_availability_field ($data)
 Process the legacy availability fields table record. More...
 
 restore_module_structure_step::process_availability_field ($data)
 Process the legacy availability fields table record. More...
 
 restore_badges_structure_step::process_badge ($data)
 
 restore_block_instance_structure_step::process_block ($data)
 
 restore_calendarevents_structure_step::process_calendarevents ($data)
 
 restore_course_structure_step::process_category ($data)
 
 restore_comments_structure_step::process_comment ($data)
 
 restore_userscompletion_structure_step::process_completion ($data)
 
 restore_filters_structure_step::process_config ($data)
 
moodledatabase restore_course_structure_step::process_course ($data)
 Processing functions go here. More...
 
 restore_course_competencies_structure_step::process_course_competency ($data)
 Process a course competency. More...
 
 restore_course_competencies_structure_step::process_course_competency_settings ($data)
 Process a course competency settings. More...
 
moodle_database restore_course_completion_structure_step::process_course_completion_aggr_methd ($data)
 Process course completion aggregate methods. More...
 
moodle_database restore_course_completion_structure_step::process_course_completion_crit_compl ($data)
 Processes course compltion criteria complete records. More...
 
moodle_database restore_course_completion_structure_step::process_course_completion_criteria ($data)
 Process course completion criteria. More...
 
moodle_database restore_course_completion_structure_step::process_course_completions ($data)
 Process course completions. More...
 
 restore_section_structure_step::process_course_format_options ($data)
 
 restore_activity_competencies_structure_step::process_course_module_competency ($data)
 Process a course module competency. More...
 
 restore_badges_structure_step::process_criterion ($data)
 
 restore_course_structure_step::process_customfield ($data)
 Process custom fields. More...
 
 restore_badges_structure_step::process_endorsement ($data)
 Create an endorsement for a badge. More...
 
 restore_enrolments_structure_step::process_enrol ($data)
 Create enrolment instances. More...
 
 restore_enrolments_structure_step::process_enrolment ($data)
 Create user enrolments. More...
 
 restore_load_included_files::process_file ($data)
 Process one <file> element from files.xml. More...
 
 restore_gradebook_structure_step::process_grade_category ($data)
 
 restore_gradebook_structure_step::process_grade_grade ($data)
 
 restore_grade_history_structure_step::process_grade_grade ($data)
 
 restore_activity_grades_structure_step::process_grade_grade ($data)
 
 restore_activity_grade_history_structure_step::process_grade_grade ($data)
 
 restore_gradebook_structure_step::process_grade_item ($data)
 
 restore_activity_grades_structure_step::process_grade_item ($data)
 
 restore_gradebook_structure_step::process_grade_letter ($data)
 
 restore_activity_grades_structure_step::process_grade_letter ($data)
 process activity grade_letters. More...
 
 restore_gradebook_structure_step::process_grade_setting ($data)
 
 restore_activity_grading_structure_step::process_grading_area ($data)
 Processes one grading area element. More...
 
 restore_activity_grading_structure_step::process_grading_definition ($data)
 Processes one grading definition element. More...
 
 restore_activity_grading_structure_step::process_grading_instance ($data)
 Processes one grading form instance element. More...
 
 restore_groups_structure_step::process_group ($data)
 
 restore_groups_members_structure_step::process_group ($data)
 
 restore_groups_structure_step::process_grouping ($data)
 
 restore_groups_structure_step::process_grouping_group ($data)
 
 restore_course_logs_structure_step::process_log ($data)
 
 restore_activity_logs_structure_step::process_log ($data)
 
 restore_course_logstores_structure_step::process_logstore ($data)
 Process the 'logstore' element,. More...
 
 restore_badges_structure_step::process_manual_award ($data)
 
 restore_groups_members_structure_step::process_member ($data)
 
 restore_module_structure_step::process_module ($data)
 
 restore_outcomes_structure_step::process_outcome ($data)
 
 restore_ras_and_caps_structure_step::process_override ($data)
 
 restore_badges_structure_step::process_parameter ($data)
 
 restore_badges_structure_step::process_relatedbadge ($data)
 Link to related badges for a badge. More...
 
 restore_scales_structure_step::process_scale ($data)
 
 restore_section_structure_step::process_section ($data)
 
 restore_course_structure_step::process_tag ($data)
 
 restore_module_structure_step::process_tag ($data)
 Fetch all the existing because tag_set() deletes them so everything must be reinserted on each call. More...
 
 restore_course_competencies_structure_step::process_user_competency_course ($data)
 Process the user competency course. More...
 
static restore_section_structure_step::reset_caches ()
 Resets a static cache of course formats. More...
 
 restore_gradebook_structure_step::rewrite_step_backup_file_for_legacy_freeze ($filepath)
 Rewrite step definition to handle the legacy freeze attribute. More...
 
 drop_and_clean_temp_stuff::skip_cleaning_temp_dir ($skip)
 

Variables

foreach($mods as $mod=> $moddir) $blocks = core_component::get_plugin_list('block')
 
foreach($mods as $mod=> $moddir) $blocks = core_component::get_plugin_list('block')
 
global $CFG
 
global $CFG
 
global $CFG
 
 restore_enrolments_structure_step::$enrolsynced = false
 
array restore_course_structure_step::$legacyallowedmodules = array()
 Used when $legacyrestrictmodules is true. More...
 
bool restore_course_structure_step::$legacyrestrictmodules = false
 this gets set to true by process_course() if we are restoring an old coures that used the legacy 'module security' feature. More...
 
global $LINKS_ENCODERS_CACHE = array()
 
 $mods = core_component::get_plugin_list('mod')
 
 $mods = core_component::get_plugin_list('mod')
 
 restore_enrolments_structure_step::$originalstatus = array()
 
 restore_groups_members_structure_step::$plugins = null
 
 restore_ras_and_caps_structure_step::$plugins = null
 
 restore_enrolments_structure_step::$plugins = null
 
 drop_and_clean_temp_stuff::$skipcleaningtempdir = false
 

Detailed Description

Function Documentation

◆ after_execute() [1/7]

restore_groups_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [2/7]

restore_scales_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [3/7]

restore_outcomes_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [4/7]

restore_section_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [5/7]

restore_course_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [6/7]

restore_badges_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_execute() [7/7]

restore_calendarevents_structure_step::after_execute ( )
protected

This method will be executed after the whole structure step have been processed.

After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed

Reimplemented from restore_structure_step.

◆ after_restore() [1/2]

restore_activity_grades_structure_step::after_restore ( )

This method will be executed after the rest of the restore has been processed.

Use if you need to update IDs based on things which are restored after this step has completed.

Reimplemented from restore_structure_step.

◆ after_restore() [2/2]

restore_module_structure_step::after_restore ( )
protected

This method will be executed after the rest of the restore has been processed.

Update old tag instance itemid(s).

Reimplemented from restore_structure_step.

◆ check_minmaxtouse()

restore_gradebook_structure_step::check_minmaxtouse ( )
protected

Checks what should happen with the course grade setting minmaxtouse.

This is related to the upgrade step at the time the setting was added.

See also
MDL-48618
Return values
void

◆ define_structure() [1/25]

restore_gradebook_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [2/25]

restore_grade_history_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [3/25]

restore_load_included_files::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [4/25]

restore_groups_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [5/25]

restore_groups_members_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [6/25]

restore_scales_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [7/25]

restore_outcomes_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [8/25]

restore_section_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [9/25]

restore_course_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [10/25]

restore_ras_and_caps_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [11/25]

restore_enrolments_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [12/25]

restore_filters_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [13/25]

restore_comments_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [14/25]

restore_badges_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [15/25]

restore_calendarevents_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [16/25]

restore_course_completion_structure_step::define_structure ( )
protected

Define the course completion structure.

Return values
arrayArray of restore_path_element

Reimplemented from restore_structure_step.

◆ define_structure() [17/25]

restore_course_logs_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [18/25]

restore_course_logstores_structure_step::define_structure ( )
protected

Return the elements to be processed on restore of logstores.

Return values
restore_path_element[]array of elements to be processed on restore.

Reimplemented from restore_structure_step.

◆ define_structure() [19/25]

restore_course_competencies_structure_step::define_structure ( )
protected

Returns the structure.

Return values
array

Reimplemented from restore_structure_step.

◆ define_structure() [20/25]

restore_activity_competencies_structure_step::define_structure ( )
protected

Defines the structure.

Return values
array

Reimplemented from restore_structure_step.

◆ define_structure() [21/25]

restore_activity_grades_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [22/25]

restore_activity_grade_history_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [23/25]

restore_block_instance_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [24/25]

restore_module_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ define_structure() [25/25]

restore_userscompletion_structure_step::define_structure ( )
protected

Function that will return the structure to be processed by this restore_step.

Must return one array of @restore_path_element elements

Reimplemented from restore_structure_step.

◆ execute_condition() [1/11]

restore_gradebook_structure_step::execute_condition ( )
protected

To conditionally decide if this step must be executed Note the "settings" conditions are evaluated in the corresponding task.

Here we check for other conditions not being restore settings (files, site settings...)

Reimplemented from restore_structure_step.

◆ execute_condition() [2/11]

restore_grade_history_structure_step::execute_condition ( )
protected

To conditionally decide if one step will be executed or no.

For steps needing to be executed conditionally, based in dynamic conditions (at execution time vs at declaration time) you must override this function. It will return true if the step must be executed and false if not

Reimplemented from restore_structure_step.

◆ execute_condition() [3/11]

restore_enrolments_structure_step::execute_condition ( )
protected

Conditionally decide if this step should be executed.

This function checks the following parameter:

  1. the course/enrolments.xml file exists
Return values
booltrue is safe to execute, false otherwise

Reimplemented from restore_structure_step.

◆ execute_condition() [4/11]

restore_badges_structure_step::execute_condition ( )
protected

Conditionally decide if this step should be executed.

This function checks the following parameters:

  1. Badges and course badges are enabled on the site.
  2. The course/badges.xml file exists.
  3. All modules are restorable.
  4. All modules are marked for restore.
Return values
boolTrue is safe to execute, false otherwise

Reimplemented from restore_structure_step.

◆ execute_condition() [5/11]

restore_course_completion_structure_step::execute_condition ( )
protected

Conditionally decide if this step should be executed.

This function checks parameters that are not immediate settings to ensure that the enviroment is suitable for the restore of course completion info.

This function checks the following four parameters:

  1. Course completion is enabled on the site
  2. The backup includes course completion information
  3. All modules are restorable
  4. All modules are marked for restore.
  5. No completion criteria already exist for the course.
Return values
boolTrue is safe to execute, false otherwise

Reimplemented from restore_structure_step.

◆ execute_condition() [6/11]

restore_course_logs_structure_step::execute_condition ( )
protected

Conditionally decide if this step should be executed.

This function checks the following parameter:

  1. the course/logs.xml file exists
Return values
booltrue is safe to execute, false otherwise

Reimplemented from restore_structure_step.

◆ execute_condition() [7/11]

restore_course_logstores_structure_step::execute_condition ( )
protected

Conditionally decide if this step should be executed.

This function checks the following parameter:

  1. the logstores.xml file exists
Return values
booltrue is safe to execute, false otherwise

Reimplemented from restore_structure_step.

◆ execute_condition() [8/11]

restore_course_competencies_structure_step::execute_condition ( )
protected

Execute conditions.

Return values
bool

Reimplemented from restore_structure_step.

◆ execute_condition() [9/11]

restore_activity_competencies_structure_step::execute_condition ( )
protected

Execute conditions.

Return values
bool

Reimplemented from restore_structure_step.

◆ execute_condition() [10/11]

restore_activity_grades_structure_step::execute_condition ( )
protected

No grades in front page.

Return values
bool

Reimplemented from restore_structure_step.

◆ execute_condition() [11/11]

restore_userscompletion_structure_step::execute_condition ( )
protected

To conditionally decide if this step must be executed Note the "settings" conditions are evaluated in the corresponding task.

Here we check for other conditions not being restore settings (files, site settings...)

Reimplemented from restore_structure_step.

◆ gradebook_calculation_freeze()

restore_gradebook_structure_step::gradebook_calculation_freeze ( )
protected

Freeze gradebook calculation if needed.

This is similar to various upgrade scripts that check if the freeze is needed.

◆ prepare_activity_structure()

backup_activity_structure_step::prepare_activity_structure (   $activitystructure)
protected

Wraps any activity backup structure within the common 'activity' element that will include common to all activities information like id, context...

Parameters
backup_nested_element$activitystructurethe element to wrap
Return values
backup_nested_elementthe $activitystructure wrapped by the common 'activity' element

◆ process_alignment()

restore_badges_structure_step::process_alignment (   $data)

Link to an alignment for a badge.

Parameters
mixed$data
Return values
void

◆ process_assignment()

restore_ras_and_caps_structure_step::process_assignment (   $data)

Assign roles.

This has to be called after enrolments processing.

Parameters
mixed$data
Return values
void

◆ process_availability() [1/2]

restore_section_structure_step::process_availability (   $data)

Process the legacy availability table record.

This table does not exist in Moodle 2.7+ but we still support restore.

Parameters
stdClass$dataRecord data

◆ process_availability() [2/2]

restore_module_structure_step::process_availability (   $data)
protected

Process the legacy availability table record.

This table does not exist in Moodle 2.7+ but we still support restore.

Parameters
stdClass$dataRecord data

◆ process_availability_field() [1/2]

restore_section_structure_step::process_availability_field (   $data)

Process the legacy availability fields table record.

This table does not exist in Moodle 2.7+ but we still support restore.

Parameters
stdClass$dataRecord data

◆ process_availability_field() [2/2]

restore_module_structure_step::process_availability_field (   $data)
protected

Process the legacy availability fields table record.

This table does not exist in Moodle 2.7+ but we still support restore.

Parameters
stdClass$dataRecord data

◆ process_course()

moodledatabase restore_course_structure_step::process_course (   $data)

Processing functions go here.

$DB

Parameters
stdClass$data

◆ process_course_competency()

restore_course_competencies_structure_step::process_course_competency (   $data)

Process a course competency.

Parameters
array$dataThe data.

◆ process_course_competency_settings()

restore_course_competencies_structure_step::process_course_competency_settings (   $data)

Process a course competency settings.

Parameters
array$dataThe data.

◆ process_course_completion_aggr_methd()

moodle_database restore_course_completion_structure_step::process_course_completion_aggr_methd (   $data)

Process course completion aggregate methods.

$DB

Parameters
stdClass$data

◆ process_course_completion_crit_compl()

moodle_database restore_course_completion_structure_step::process_course_completion_crit_compl (   $data)

Processes course compltion criteria complete records.

$DB

Parameters
stdClass$data

◆ process_course_completion_criteria()

moodle_database restore_course_completion_structure_step::process_course_completion_criteria (   $data)

Process course completion criteria.

$DB

Parameters
stdClass$data

◆ process_course_completions()

moodle_database restore_course_completion_structure_step::process_course_completions (   $data)

Process course completions.

$DB

Parameters
stdClass$data

◆ process_course_module_competency()

restore_activity_competencies_structure_step::process_course_module_competency (   $data)

Process a course module competency.

Parameters
array$dataThe data.

◆ process_customfield()

restore_course_structure_step::process_customfield (   $data)

Process custom fields.

Parameters
array$data

◆ process_endorsement()

restore_badges_structure_step::process_endorsement (   $data)

Create an endorsement for a badge.

Parameters
mixed$data
Return values
void

◆ process_enrol()

restore_enrolments_structure_step::process_enrol (   $data)

Create enrolment instances.

This has to be called after creation of roles and before adding of role assignments.

Parameters
mixed$data
Return values
void

◆ process_enrolment()

restore_enrolments_structure_step::process_enrolment (   $data)

Create user enrolments.

This has to be called after creation of enrolment instances and before adding of role assignments.

Roles are assigned in restore_ras_and_caps_structure_step::process_assignment() processing afterwards.

Parameters
mixed$data
Return values
void

◆ process_file()

restore_load_included_files::process_file (   $data)

Process one <file> element from files.xml.

Parameters
array$datathe element data

◆ process_grade_letter()

restore_activity_grades_structure_step::process_grade_letter (   $data)
protected

process activity grade_letters.

Note that, while these are possible, because grade_letters are contextid based, in practice, only course context letters can be defined. So we keep here this method knowing it won't be executed ever. gradebook restore will restore course letters.

◆ process_grading_area()

restore_activity_grading_structure_step::process_grading_area (   $data)
protected

Processes one grading area element.

Parameters
array$dataelement data

◆ process_grading_definition()

restore_activity_grading_structure_step::process_grading_definition (   $data)
protected

Processes one grading definition element.

Parameters
array$dataelement data

◆ process_grading_instance()

restore_activity_grading_structure_step::process_grading_instance (   $data)
protected

Processes one grading form instance element.

Parameters
array$dataelement data

◆ process_logstore()

restore_course_logstores_structure_step::process_logstore (   $data)
protected

Process the 'logstore' element,.

Note: This is empty by definition in backup, because stores do not share any data between them, so there is nothing to process here.

Parameters
array$dataelement data

◆ process_relatedbadge()

restore_badges_structure_step::process_relatedbadge (   $data)

Link to related badges for a badge.

This relies on post processing in after_execute().

Parameters
mixed$data
Return values
void

◆ process_tag()

restore_module_structure_step::process_tag (   $data)
protected

Fetch all the existing because tag_set() deletes them so everything must be reinserted on each call.

Parameters
stdClass$dataRecord data

◆ process_user_competency_course()

restore_course_competencies_structure_step::process_user_competency_course (   $data)

Process the user competency course.

Parameters
array$dataThe data.

◆ reset_caches()

static restore_section_structure_step::reset_caches ( )
static

Resets a static cache of course formats.

Required for unit testing.

◆ rewrite_step_backup_file_for_legacy_freeze()

restore_gradebook_structure_step::rewrite_step_backup_file_for_legacy_freeze (   $filepath)
protected

Rewrite step definition to handle the legacy freeze attribute.

In previous backups the calculations_freeze property was stored as an attribute of the top level node <gradebook>. The backup API, however, do not process grandparent nodes. It only processes definitive children, and their parent attributes.

We had:

<gradebook calculations_freeze="20160511"> <grade_categories> <grade_category id="10"> <depth>1</depth> ... </grade_category> </grade_categories> ... </gradebook>

And this method will convert it to:

<gradebook > <attributes> <calculations_freeze>20160511</calculations_freeze> </attributes> <grade_categories> <grade_category id="10"> <depth>1</depth> ... </grade_category> </grade_categories> ... </gradebook>

Note that we cannot just load the XML file in memory as it could potentially be huge. We can also completely ignore if the node <attributes> is already in the backup file as it never existed before.

Parameters
string$filepathThe absolute path to the XML file.
Return values
void

Variable Documentation

◆ $legacyallowedmodules

array restore_course_structure_step::$legacyallowedmodules = array()
protected

Used when $legacyrestrictmodules is true.

This is an array with array keys the module names ('forum', 'quiz', etc.). These are the modules that are allowed according to the data in the backup file. In after_execute() we then have to prevent adding of all the other types of activity.

◆ $legacyrestrictmodules

bool restore_course_structure_step::$legacyrestrictmodules = false
protected

this gets set to true by process_course() if we are restoring an old coures that used the legacy 'module security' feature.

If so, we have to do more work in after_execute().