Skip to content
Snippets Groups Projects
Commit 7175f5f7 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Introduced new config for the backup path of lifecycle backups

parent 9c919b82
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ class backup_manager { ...@@ -58,7 +58,7 @@ class backup_manager {
$archivefile = date("Y-m-d") . "-ID-{$recordid}-COURSE-{$courseid}.mbz"; $archivefile = date("Y-m-d") . "-ID-{$recordid}-COURSE-{$courseid}.mbz";
// Path of backup folder. // Path of backup folder.
$path = $CFG->dataroot . '/lifecycle_backups'; $path = get_config('tool_lifecycle', 'backup_path');
// If the path doesn't exist, make it so! // If the path doesn't exist, make it so!
if (!is_dir($path)) { if (!is_dir($path)) {
umask(0000); umask(0000);
...@@ -119,7 +119,7 @@ class backup_manager { ...@@ -119,7 +119,7 @@ class backup_manager {
$targetfilename = \restore_controller::get_tempdir_name($backuprecord->courseid, get_admin()->id); $targetfilename = \restore_controller::get_tempdir_name($backuprecord->courseid, get_admin()->id);
$target = $backuptmpdir . '/' . $targetfilename; $target = $backuptmpdir . '/' . $targetfilename;
// Create the location of the actual backup file. // Create the location of the actual backup file.
$source = $CFG->dataroot . '/lifecycle_backups/' . $backuprecord->backupfile; $source = get_config('tool_lifecycle', 'backup_path') . DIRECTORY_SEPARATOR . $backuprecord->backupfile;
// Check if the backup file exists. // Check if the backup file exists.
if (!file_exists($source)) { if (!file_exists($source)) {
throw new \moodle_exception('errorbackupfiledoesnotexist', 'tool_lifecycle', $source); throw new \moodle_exception('errorbackupfiledoesnotexist', 'tool_lifecycle', $source);
......
...@@ -34,6 +34,9 @@ $string['config_delay_duration'] = 'Default duration of a course delay'; ...@@ -34,6 +34,9 @@ $string['config_delay_duration'] = 'Default duration of a course delay';
$string['config_delay_duration_desc'] = 'This setting defines the default delay duration of a workflow $string['config_delay_duration_desc'] = 'This setting defines the default delay duration of a workflow
in case one of its processes is rolled back or finishes. in case one of its processes is rolled back or finishes.
The delay duration determines how long a course will be excepted from being processed again in either of the cases.'; The delay duration determines how long a course will be excepted from being processed again in either of the cases.';
$string['config_backup_path'] = 'Path of the lifecycle backup folder';
$string['config_backup_path_desc'] = 'This settings defines the storage location of the backups created by the backup step.
The path has to be specified as an absolute path on your server.';
$string['active_processes_list_header'] = 'Active processes'; $string['active_processes_list_header'] = 'Active processes';
$string['adminsettings_heading'] = 'Workflow settings'; $string['adminsettings_heading'] = 'Workflow settings';
$string['active_manual_workflows_heading'] = 'Active manual workflows'; $string['active_manual_workflows_heading'] = 'Active manual workflows';
......
...@@ -38,6 +38,11 @@ if ($hassiteconfig) { ...@@ -38,6 +38,11 @@ if ($hassiteconfig) {
get_string('config_delay_duration_desc', 'tool_lifecycle'), get_string('config_delay_duration_desc', 'tool_lifecycle'),
183 * 24 * 60 * 60)); // Dafault value is 180 days. 183 * 24 * 60 * 60)); // Dafault value is 180 days.
$settings->add(new admin_setting_configtext('tool_lifecycle/backup_path',
get_string('config_backup_path', 'tool_lifecycle'),
get_string('config_backup_path_desc', 'tool_lifecycle'),
$CFG->dataroot . DIRECTORY_SEPARATOR . 'lifecycle_backups'));
$ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_active_processes()); $ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_active_processes());
$ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_course_backups()); $ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_course_backups());
$ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_sublugins()); $ADMIN->add('lifecycle_category', new tool_lifecycle\admin_page_sublugins());
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die; defined('MOODLE_INTERNAL') || die;
$plugin->maturity = MATURITY_BETA; $plugin->maturity = MATURITY_BETA;
$plugin->version = 2019120200; $plugin->version = 2019120201;
$plugin->component = 'tool_lifecycle'; $plugin->component = 'tool_lifecycle';
$plugin->requires = 2017111300; // Require Moodle 3.4 (or above). $plugin->requires = 2017111300; // Require Moodle 3.4 (or above).
$plugin->release = 'v3.8-r1'; $plugin->release = 'v3.8-r1';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment