diff --git a/admin/settings/server.php b/admin/settings/server.php index 29a5966906e..4b3b11e85e9 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -153,6 +153,19 @@ $temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_strin 60 => new lang_string('numdays', '', 60), 30 => new lang_string('numdays', '', 30)))); +$temp->add(new admin_setting_configselect('tempdatafoldercleanup', new lang_string('tempdatafoldercleanup', 'admin'), + new lang_string('configtempdatafoldercleanup', 'admin'), 168, array( + 1 => new lang_string('numhours', '', 1), + 3 => new lang_string('numhours', '', 3), + 6 => new lang_string('numhours', '', 6), + 9 => new lang_string('numhours', '', 9), + 12 => new lang_string('numhours', '', 12), + 18 => new lang_string('numhours', '', 18), + 24 => new lang_string('numhours', '', 24), + 48 => new lang_string('numdays', '', 2), + 168 => new lang_string('numdays', '', 7), +))); + $ADMIN->add('server', $temp); diff --git a/lang/en/admin.php b/lang/en/admin.php index 63e1d819d62..03e6231b8cf 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -342,6 +342,7 @@ $string['configstripalltitletags'] = 'Uncheck this setting to allow HTML tags in $string['configsupportemail'] = 'This email address will be published to users of this site as the one to email when they need general help (for example, when new users create their own accounts). If this email is left blank then no such helpful email address is supplied.'; $string['configsupportname'] = 'This is the name of a person or other entity offering general help via the support email or web address.'; $string['configsupportpage'] = 'This web address will be published to users of this site as the one to go to when they need general help (for example, when new users create their own accounts). If this address is left blank then no link will be supplied.'; +$string['configtempdatafoldercleanup'] = 'Remove temporary data files from the data folder that are older than the selected time.'; $string['configthemedesignermode'] = 'Normally all theme images and style sheets are cached in browsers and on the server for a very long time, for performance. If you are designing themes or developing code then you probably want to turn this mode on so that you are not served cached versions. Warning: this will make your site slower for all users! Alternatively, you can also reset the theme caches manually from the Theme selection page.'; $string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!). For example: standard,orangewhite.'; @@ -1037,6 +1038,7 @@ $string['tasksessioncleanup'] = 'Cleanup old sessions'; $string['taskstatscron'] = 'Background processing for statistics'; $string['tasktagcron'] = 'Background processing for tags'; $string['tasktempfilecleanup'] = 'Delete stale temp files'; +$string['tempdatafoldercleanup'] = 'Clean up temporary data files older than'; $string['themedesignermode'] = 'Theme designer mode'; $string['themelist'] = 'Theme list'; $string['themenoselected'] = 'No theme selected'; diff --git a/lib/classes/task/file_temp_cleanup_task.php b/lib/classes/task/file_temp_cleanup_task.php index b5aeea8d0b0..516e3c516cc 100644 --- a/lib/classes/task/file_temp_cleanup_task.php +++ b/lib/classes/task/file_temp_cleanup_task.php @@ -46,7 +46,7 @@ class file_temp_cleanup_task extends scheduled_task { $tmpdir = $CFG->tempdir; // Default to last weeks time. - $time = strtotime('-1 week'); + $time = time() - ($CFG->tempdatafoldercleanup * 3600); $dir = new \RecursiveDirectoryIterator($tmpdir); // Show all child nodes prior to their parent. diff --git a/version.php b/version.php index bc99b638e3b..5cc5a7347ab 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2014112000.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2014112000.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.