Show performance information about locks (time taken to acquire lock,
time lock is held for) in the 'perfinfo' display.
Also show existing information (that was already calculated but not
shown before) about the session lock, which is not a 'core\lock' type
lock, but the information is similarly useful.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
The $CFG->enabledashboard setting has been added to Appearance >
Navigation, to let admins disable the "Dashboard" option from the
primary navigation.
This commit also changes the behaviour of get_home_page(), to take
into account this setting and adds a new method, get_default_home_page(),
to return the expected default home page (that wil be used when current
default page is not defined or valid).
- There is now a single point for the configuration to be updated or
inserted into the DB.
- De-nestifying the code does make it longer to scroll through but you
can now edit areas of interest with more confidence, and should make
it easier to grok places of interest.
- Updated DB check from get_field to get_record as it's better in the
case of an update - using the id.
- Updates will happen on the ID field, which should be the primary key
for the table.
- Cache won't be invalidated if no changes were made.
- Property does not need to be checked for behat test if you are just
inserting a new value to an array using the arr[] = value syntax as it
should just work.
- Opted to replace array_key_exists with isset which is a faster check
due to it being a language construct and the fact that it should NOT
contain null values (as a null value would be removed) should mean
this is a safe change.
- Cleanup function param defaults.
- Prefer [] arrays instead of array() declarations.
For cache types which mean this information can be obtained without a
significant performance cost (i.e. just by calling strlen and not
having to serialize something that wasn't serialized already),
this change calculates the size of data read from or written to cache
in each request and includes it in the perfdebug table at bottom of
output (when that is turned on).
This supports the following cache types:
* File store
* Redis (only if caching is enabled)
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).