Skip to content

Commit

Permalink
MDL-28180 backup - set excluded activities for any non-course operation
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Dec 11, 2011
1 parent 6508da4 commit fa6cad6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backup/controller/backup_controller.class.php
Expand Up @@ -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();
}

Expand Down
8 changes: 8 additions & 0 deletions backup/controller/restore_controller.class.php
Expand Up @@ -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();
}

Expand Down
1 change: 1 addition & 0 deletions backup/util/plan/backup_plan.class.php
Expand Up @@ -44,6 +44,7 @@ public function __construct($controller) {
}
$this->controller = $controller;
$this->basepath = $CFG->dataroot . '/temp/backup/' . $controller->get_backupid();
$this->excludingdactivities = false;
parent::__construct('backup_plan');
}

Expand Down

0 comments on commit fa6cad6

Please sign in to comment.