Permalink
Browse files

MDL-28180 backup - set excluded activities for any non-course operation

  • Loading branch information...
1 parent acb3bf8 commit ff4a2ddef77e1d34d8ba120840fa836b4839df73 @stronk7 stronk7 committed Dec 11, 2011
@@ -293,6 +293,14 @@ public function execute_plan() {
// Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
+ // If this is not a course backup, inform the plan we are not
+ // including all the activities for sure. This will affect any
+ // task/step executed conditionally to stop including information
+ // for section and activity backup. MDL-28180.
+ if ($this->get_type() !== backup::TYPE_1COURSE) {
+ $this->log('notifying plan about excluded activities by type', backup::LOG_DEBUG);
+ $this->plan->set_excluding_activities();
+ }
return $this->plan->execute();
}
@@ -299,6 +299,14 @@ public function execute_plan() {
// Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
+ // If this is not a course restore, inform the plan we are not
+ // including all the activities for sure. This will affect any
+ // task/step executed conditionally to stop processing information
+ // for section and activity restore. MDL-28180.
+ if ($this->get_type() !== backup::TYPE_1COURSE) {
+ $this->log('notifying plan about excluded activities by type', backup::LOG_DEBUG);
+ $this->plan->set_excluding_activities();
+ }
return $this->plan->execute();
}
@@ -44,6 +44,7 @@ public function __construct($controller) {
}
$this->controller = $controller;
$this->basepath = $CFG->tempdir . '/backup/' . $controller->get_backupid();
+ $this->excludingdactivities = false;
parent::__construct('backup_plan');
}

0 comments on commit ff4a2dd

Please sign in to comment.