Within a very large project, it was found that searching for a user with their username in the user table using a case insensitive
search was inefficient. Instead it is proposed that the username input is made to be lowercase prior to executing a database query
as the username for each user in the database must be lowercase. This allows for a case sensitive query to find the user data.
Essentially we are moving a case insensitive search for a user from SQL into PHP to increase performance.
components are loaded very early in Moodle bootstrap/warmup
process. So, basically, core_component must be vanilla php
and moodlelib/weblib facilitites are not available yet.
So, changing debugging() call to error_log(), to make it
consistent with the rest of the calls in the method.
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).
Commit 637da99edbd7258fae20374ed8c890a167f40d30 has introduced changes
for removing trailing zeroes from the output of function format_float.
Due to a small omission, the function causes a PHP warning when the
string decsep is set to a tilde character ('~'). This is rarely the
case.
The bug lies in using PHP function preg_replace with a string that
contains external input (in this case, including decsep), but without
escaping it for PCRE processing.
This commit fixes the function to also support a tilde character in
string decsep. It also adds tests for having tilde as decimal separator.
Thanks-To: Jake Dallimore <jake@moodle.com>