mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 20:53:53 +01:00
MDL-77955 moodlenet: destroy backup controller in class destructor.
This ensures that it's always cleaned up during tests, where not doing so can cause spurious errors on Windows.
This commit is contained in:
parent
7beda01cae
commit
78d24550af
@ -63,6 +63,13 @@ class activity_packager {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
public function __destruct() {
|
||||
$this->controller->destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the backup file using appropriate setting overrides and return relevant information.
|
||||
*
|
||||
@ -133,8 +140,6 @@ class activity_packager {
|
||||
// Execute the backup and fetch the result.
|
||||
$this->controller->execute_plan();
|
||||
$result = $this->controller->get_results();
|
||||
// Controller no longer required.
|
||||
$this->controller->destroy();
|
||||
|
||||
if (!isset($result['backup_destination'])) {
|
||||
throw new \moodle_exception('Failed to package activity.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user