Commit Graph

14 Commits

Author SHA1 Message Date
sam marshall
201b6db1ac MDL-77149 core_files: Network filesystem (Amazon EFS) can warn
If you delete a file with a hash and then create another file with
the same hash, sometimes on EFS filesystems while trying to create
the new file, it returns true to the file_exists check even though
the file doesn't exist, but then fails other calls.

This change makes Moodle tolerate that behaviour.
2023-02-21 10:53:31 +00:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Tim Hunt
1af25720b0 MDL-71991 files: check return value of rename when writing files 2021-06-22 19:36:09 +01:00
Marina Glancy
b88f1a84bf MDL-70901 core: @ no longer masks errors in PHP 8.0 2021-02-22 16:18:46 +01:00
Marina Glancy
a1a72f720e MDL-70901 core_files: @ does no mask errors in php8 anymore 2021-02-22 16:17:49 +01:00
Mark Nelson
94c71056a3 MDL-35773 core_backup: use existing API to recover files 2019-07-26 11:59:56 +08:00
Mark Nelson
88031d35de MDL-35773 core: revert introduction of new recover_file() method
Also -

1. Reverted recover_file() in file_system_filedir back to its
   original state.
2. Removed no longer needed method create_recovery_record().
2019-07-26 11:59:56 +08:00
Matt Porritt
d7e4481e98 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.
2019-07-26 11:59:56 +08:00
Mark Nielsen
9eb1a2c31a MDL-59961 core_files: make content hash validation reusable
Other file systems could make use of this code as they
all need to validate the content has and be able to read
the file from disk.
2017-08-28 11:15:12 -07:00
Andrew Nicols
9020212522 MDL-58718 filestorage: Normalise file paths for Windows 2017-04-26 09:36:10 +08:00
Andrew Nicols
a30a04fa01 MDL-58297 filestorage: New functions for hash calculation 2017-04-07 10:40:23 +08:00
Tony Butler
efa7d24168 MDL-57801 core_filestorage: Delete temp file if disk space runs out 2017-02-16 12:41:06 +00:00
Tony Butler
961323a05f MDL-57801 core_filestorage: Verify hash of temp file before committing
This addresses an edge scenario on NFS filesystems with no space
remaining, where subsequent uploads fail silently while zero byte files
are saved to the pool (and for some reason the filesize check passes).
2017-02-16 12:38:58 +00:00
Andrew Nicols
16a34ae189 MDL-46375 core_files: Split parts of file_storage into new file system
This change moves all operations which deal with the fetching/updating, or
setting of files from the file_storage class into a new file_system class.

A new file_system can be specified in the config.php and used to replace
all relevant methods in order to move the file system component to an
alternative solution.
2017-02-14 08:42:28 +08:00