diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 55e04bbcf53..ad60b72a22e 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -767,6 +767,7 @@ class restore_decode_interlinks extends restore_execution_step { protected function define_execution() { // Get the decoder (from the plan) + /** @var restore_decode_processor $decoder */ $decoder = $this->task->get_decoder(); restore_decode_processor::register_link_decoders($decoder); // Add decoder contents and rules // And launch it, everything will be processed @@ -5468,17 +5469,22 @@ class restore_process_file_aliases_queue extends restore_execution_step { protected function define_execution() { global $DB; - $this->log('processing file aliases queue', backup::LOG_DEBUG); - $fs = get_file_storage(); // Load the queue. + $aliascount = $DB->count_records('backup_ids_temp', + ['backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue']); $rs = $DB->get_recordset('backup_ids_temp', - array('backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue'), + ['backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue'], '', 'info'); + $this->log('processing file aliases queue. ' . $aliascount . ' entries.', backup::LOG_DEBUG); + $progress = $this->task->get_progress(); + $progress->start_progress('Processing file aliases queue', $aliascount); + // Iterate over aliases in the queue. foreach ($rs as $record) { + $progress->increment_progress(); $info = backup_controller_dbops::decode_backup_temp_info($record->info); // Try to pick a repository instance that should serve the alias. @@ -5603,6 +5609,7 @@ class restore_process_file_aliases_queue extends restore_execution_step { } } } + $progress->end_progress(); $rs->close(); } diff --git a/backup/util/helper/restore_decode_processor.class.php b/backup/util/helper/restore_decode_processor.class.php index 0c7bf1e2cd7..37f7a1566a8 100644 --- a/backup/util/helper/restore_decode_processor.class.php +++ b/backup/util/helper/restore_decode_processor.class.php @@ -77,6 +77,7 @@ class restore_decode_processor { */ public function execute() { // Iterate over all contents, visiting them + /** @var restore_decode_content $content */ foreach ($this->contents as $content) { $content->process($this); } diff --git a/backup/util/plan/restore_plan.class.php b/backup/util/plan/restore_plan.class.php index 185556d05ae..cd69b818f71 100644 --- a/backup/util/plan/restore_plan.class.php +++ b/backup/util/plan/restore_plan.class.php @@ -201,9 +201,16 @@ class restore_plan extends base_plan implements loggable { */ public function execute_after_restore() { // Simply iterate over each task in the plan and delegate to them the execution + $progress = $this->get_progress(); + $progress->start_progress($this->get_name() . + ': executing execute_after_restore for all tasks', count($this->tasks)); + + /** @var base_task $task */ foreach ($this->tasks as $task) { $task->execute_after_restore(); + $progress->increment_progress(); } + $progress->end_progress(); } }