Skip to content
Browse files

MDL-24419 (1): Core restore steps should have after_restore function

At present core restore steps cannot have an after_restore function,
even though plugin restore steps can. Technically it would be possible
to just override the launch_after_restore_methods function but this
is not very neat. Instead, I added code to call after_restore function
(exactly the same way after_execute works).
  • Loading branch information...
1 parent 71d7bc3 commit 1cf121e1d2651f165cc0b9f0f4465e31e48cef21 @sammarshallou sammarshallou committed Apr 2, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 backup/util/plan/restore_structure_step.class.php
View
12 backup/util/plan/restore_structure_step.class.php
@@ -395,6 +395,8 @@ public function launch_after_restore_methods() {
$pobject->launch_after_restore_methods();
}
}
+ // Finally execute own (restore_structure_step) after_restore method
+ $this->after_restore();
}
/**
@@ -409,6 +411,16 @@ protected function after_execute() {
}
/**
+ * 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.
+ */
+ protected function after_restore() {
+ // do nothing by default
+ }
+
+ /**
* Prepare the pathelements for processing, looking for duplicates, applying
* processing objects and other adjustments
*/

0 comments on commit 1cf121e

Please sign in to comment.
Something went wrong with that request. Please try again.