Some errors can happen really early in Moodle bootstrap/warmup
(basically when executing setup.php stuff, before general libraries
are loaded and available).
That's called "early errors" and there are good parts within
setuplib.php that must be able to run without any dependency
other than vanilla php code.
It seems that, along the years, some dependencies have been
added (calls to debugging(), to s()....) and they worked mostly
ok because early errors are rare.
This commit just makes all those dependencies conditional so,
if an early error is detected... the exception handler will
return real information about he error happening and not
handler own errors (like it's happening now).
Upgrade the support for Open Badges 2 to support a real open badges 2 backpack.
Moodle can only talk to one backpack at a time, so after switching backpacks, users
will have to manually disconnect and then reconnect their backpack to the new one.
This commit combines several changes:
* Split classes into badges namespace
* Publish expiry data with a badge
* Publish badge alignments in badges exported to the backpack.
* Export the criteria for a badge to the backpack.
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
Shutdown handlers are processed in order. If something in a shutdown
handler uses a file which is stored in a per-request directory, and
another, unrelated, per-request directory was created before the handler
started. then a fresh per-request directory will be required.
This chagne adds support for a new feature known as Context Locking.
This allows a context to be locked, thereby removing all write
capabilities for all users (including admin) for that context, and all
child contexts.
The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.
Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
This class was deprecated under MDL-52471 and was showing debugging notice from Moodle 3.0.1
In PHP7.2 the class declaration fails with fatal error even if it's not used anywhere
When the wwwroot indicates https support and a page is accessed over http,
redirect to the wwwroot. This is a better experience than displaying an error.
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
This adds functionality to create individual request directories which can
be only be used for the current request. They are removed by a shutdown
handler.