This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration
It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.
So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
The parameter $size of the following functions has been deprecated and is not used any more:
- file_extension_icon
- file_file_icon
- file_folder_icon
- file_mimetype_icon
- mimeinfo_from_type
- url_guess_icon
That way, the sized icons (xxxxxxx-yyy.png) can be removed and replaced by SVG, to make it easier
to keep them updated because once they are replaced, there will only be one single file for each
MIME icon.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
Allows display_size to use a fixed unit for easy comparison of
multiple results, and fixed decimal places for the same reason.
Improves behaviour by using consistent decimal places and a
consistent space before the unit (the previous one only has a space
before 'bytes', not before 'KB').
Of existing uses, all the ones that displayed a 'maxbytes' type
configuration setting (which are likely to have an 'exact' size
and would be better shown as 512 KB rather than 512.0 KB) have been
changed to use 0 decimal places, to preserve previous behaviour.
All the uses which were showing an actual file or memory size have
been left as default (1 decimal place).
PHP8.0 shows error that filter function accepts value by reference
The nested filtering was never working but also this function was never called on a tree with sub-levels,
so this logic is now removed
This feature adds an admin tool for creating custom licenses.
Now custom licenses can be added and amended in Moodle, and the site
default can be set to a custom license.
Core licenses remain hard-coded and are uneditable, so they will always
require update within Moodle core updates, and maintain their
internationalisation through core language strings.
This also includes fundamental changes to the license API including
the addition of license caching and deprecation of no longer required
admin settings for license management.
If the user decides to remove a repository all of the linked
files are now deleted along with file references. This was causing
problems such as the course page displaying an error with no recourse
to fix the problem.
For historical reasons repositories need to call add_file_to_pool
to sync file records. However now that a before_file_created hook
has been added additional information is needed by add_file_to_pool.
Ideally add_file_to_pool and friends will become private/protected,
so we need to remove all uses of it in core.
This patch adds some new methods to the file class to allow syncing
to be managed internally by the file and the file_storage class.
This introduces a new "controlled link" file type where the file is not
stored in Moodle - but Moodle will control the access permissions on the file.
Plugins can "freeze" a filearea which means Moodle will take ownership of all the remote
files of this type.
When accessing a file, if the "filebrowser" infomation indicates the current user can write to the file, they
will be granted temporary write access.
Part of MDL-58220
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.
Repositories can now override usespost() if they don't upload using POST
requests. This restores the ability of users with
moodle/course:ignorefilesizelimits to upload files of unlimited size
lost in MDL-44626.
Changing the error message that is displayed to users when they
upload a file that is greater than the maximum upload size. Does not
include all upload cases; focuses on those most used by students.
This patch moves existing scanning functionality to plugin level. It does
not add anything new, just refactors the existing functionality.
AMOS BEGIN
MOV [clamemailsubject,core],[emailsubject,antivirus]
MOV [clamfailed,core],[clamfailed,antivirus_clamav]
MOV [clamlost,core],[invalidpathtoclam,antivirus_clamav]
MOV [clamunknownerror,core],[unknownerror,antivirus_clamav]
MOV [virusfounduser,core],[virusfounduser,antivirus]
AMOS END
The repository API defaults has a function, prepare_file, which is
responsible for creating a unique file to be used during the current
request.
This is usually used in the repository's get_file() function to store the
file before it is used elsewhere in the API to save the file to the
filestorage API.
It is also sometimes used to temporarily store credentials for the lifetime
of the session.
In all cases, this file is only expected to exist for the duration of the
session.
Switching to use of a per-request directory using make_request_directory()
ensures that the tempdir does not grow without control.
This commit also adds an upgrade step to remove all old temp directories
created by any repository currently installed.
Function repository::get_moodle_file() should always be called on packed reference and not on the source received from user.
Also added phpdocs to some other methods that were confusing source and reference