mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-35773 Backup: API should have option to not backup files
Allow both UI and automated backups to be created without including files. Instead include only file references. This is essentially implementing "SAMESITE" to backup files instead of only for import and export functionality. A new backup setting to include files (defaults to yes) has been included. The restore process will also look for and attempt to restore files from the trashdir as part of restoring backups. Additionally to support this process the ammount of time files are kept in trashdir before they are cleaned up via cron is also adjustable via admin setting.
This commit is contained in:
parent
f622ee97e3
commit
d7e4481e98
17 changed files with 190 additions and 18 deletions
|
@ -2241,7 +2241,8 @@ class file_storage {
|
|||
|
||||
// remove trash pool files once a day
|
||||
// if you want to disable purging of trash put $CFG->fileslastcleanup=time(); into config.php
|
||||
if (empty($CFG->fileslastcleanup) or $CFG->fileslastcleanup < time() - 60*60*24) {
|
||||
$filescleanupperiod = empty($CFG->filescleanupperiod) ? 86400 : $CFG->filescleanupperiod;
|
||||
if (empty($CFG->fileslastcleanup) || ($CFG->fileslastcleanup < time() - $filescleanupperiod)) {
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
// Delete files that are associated with a context that no longer exists.
|
||||
mtrace('Cleaning up files from deleted contexts... ', '');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue