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:
Matt Porritt 2018-12-10 12:27:26 +11:00 committed by Mark Nelson
parent f622ee97e3
commit d7e4481e98
17 changed files with 190 additions and 18 deletions

View file

@ -236,6 +236,15 @@ abstract class file_system {
*/
abstract public function remove_file($contenthash);
/**
* Tries to recover missing content of file from trash.
*
* @param stored_file $file stored_file instance
* @param bool $createrecord Create file record for stored file.
* @return bool success
*/
abstract public function recover_file(stored_file $file, $createrecord=false);
/**
* Check whether a file is removable.
*