MDL-78552 core: tidy up MDL_PERF constants

* all constans usable in ABORT_AFTER_CONFIG should be always defined
* MDL_PERFDB and $PERF->logwrites not used after legacy log removal
* MDL_PERF_TEST should be documented in codebase
* deprecated warnings in shutdowb manager
This commit is contained in:
Petr Skoda
2023-06-25 08:39:09 +02:00
parent 3cd84747cb
commit 3c25ccdcd1
11 changed files with 33 additions and 35 deletions
+16 -12
View File
@@ -281,21 +281,25 @@ if (!defined('PHPUNIT_TEST')) {
define('PHPUNIT_TEST', false);
}
// Performance tests needs to always display performance info, even in redirections.
// Performance tests needs to always display performance info, even in redirections;
// MDL_PERF_TEST is used in https://github.com/moodlehq/moodle-performance-comparison scripts.
if (!defined('MDL_PERF_TEST')) {
define('MDL_PERF_TEST', false);
} else {
// We force the ones we need.
if (!defined('MDL_PERF')) {
define('MDL_PERF', true);
}
if (!defined('MDL_PERFDB')) {
define('MDL_PERFDB', true);
}
if (!defined('MDL_PERFTOFOOT')) {
define('MDL_PERFTOFOOT', true);
}
}
// Make sure all MDL_PERF* constants are always defined.
if (!defined('MDL_PERF')) {
define('MDL_PERF', MDL_PERF_TEST);
}
if (!defined('MDL_PERFTOFOOT')) {
define('MDL_PERFTOFOOT', MDL_PERF_TEST);
}
if (!defined('MDL_PERFTOLOG')) {
define('MDL_PERFTOLOG', false);
}
if (!defined('MDL_PERFINC')) {
define('MDL_PERFINC', false);
}
// Note that PHPUnit and Behat tests should pass with both MDL_PERF true and false.
// When set to true MUC (Moodle caching) will be disabled as much as possible.
// A special cache factory will be used to handle this situation and will use special "disabled" equivalents objects.