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

This commit is contained in:
Eloy Lafuente (stronk7) 2011-12-11 21:37:33 +01:00
parent acb3bf8ac1
commit ff4a2ddef7
3 changed files with 17 additions and 0 deletions

View file

@ -293,6 +293,14 @@ class backup_controller extends backup implements loggable {
// Basic/initial prevention against time/memory limits // Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA); 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(); return $this->plan->execute();
} }

View file

@ -299,6 +299,14 @@ class restore_controller extends backup implements loggable {
// Basic/initial prevention against time/memory limits // Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA); 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(); return $this->plan->execute();
} }

View file

@ -44,6 +44,7 @@ class backup_plan extends base_plan implements loggable {
} }
$this->controller = $controller; $this->controller = $controller;
$this->basepath = $CFG->tempdir . '/backup/' . $controller->get_backupid(); $this->basepath = $CFG->tempdir . '/backup/' . $controller->get_backupid();
$this->excludingdactivities = false;
parent::__construct('backup_plan'); parent::__construct('backup_plan');
} }