backup MDL-24962 Backup, Restore, and Import all now explicitly destroy the UI, controller, and stage objects upon completion.
This commit is contained in:
@@ -100,4 +100,6 @@ if ($backup->enforce_changed_dependencies()) {
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display();
|
||||
$backup->destroy();
|
||||
unset($backup);
|
||||
echo $OUTPUT->footer();
|
||||
+5
-1
@@ -90,6 +90,8 @@ if ($backup->get_stage() == backup_ui::STAGE_CONFIRMATION) {
|
||||
if ($backup->get_stage() == backup_ui::STAGE_FINAL) {
|
||||
// First execute the backup
|
||||
$backup->execute();
|
||||
$backup->destroy();
|
||||
unset($backup);
|
||||
|
||||
// Check whether the backup directory still exists. If missing, something
|
||||
// went really wrong in backup, throw error. Note that backup::MODE_IMPORT
|
||||
@@ -156,4 +158,6 @@ if ($backup->enforce_changed_dependencies()) {
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display();
|
||||
echo $OUTPUT->footer();
|
||||
$backup->destroy();
|
||||
unset($backup);
|
||||
echo $OUTPUT->footer();
|
||||
@@ -54,4 +54,6 @@ if (!$restore->is_independent() && $restore->enforce_changed_dependencies()) {
|
||||
}
|
||||
echo $renderer->progress_bar($restore->get_progress_bar());
|
||||
echo $restore->display($renderer);
|
||||
$restore->destroy();
|
||||
unset($restore);
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -72,6 +72,17 @@ abstract class base_ui {
|
||||
// Process UI event before to be safe
|
||||
$this->controller->process_ui_event();
|
||||
}
|
||||
/**
|
||||
* Destorys the backup controller and the loaded stage.
|
||||
*/
|
||||
public function destroy() {
|
||||
|
||||
if ($this->controller) {
|
||||
$this->controller->destroy();
|
||||
}
|
||||
unset($this->stage);
|
||||
|
||||
}
|
||||
/**
|
||||
* Intialises what ever stage is requested. If none are requested we check
|
||||
* params for 'stage' and default to initial
|
||||
|
||||
Reference in New Issue
Block a user