From aa543e8c3985d22e0f3ff4e2a207e2e63a83b2ff Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 25 Sep 2024 23:11:20 +0800 Subject: [PATCH] MDL-83246 core: Move profiler after autoloader registration --- lib/setup.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 11d6d1d7148..a120f6697fc 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -440,12 +440,6 @@ if (!defined('MOODLE_INTERNAL')) { // Necessary because cli installer has to def // The core_component class can be used in any scripts, it does not need anything else. require_once($CFG->libdir .'/classes/component.php'); -// Early profiling start, based exclusively on config.php $CFG settings -if (!empty($CFG->earlyprofilingenabled) && !defined('ABORT_AFTER_CONFIG_CANCEL')) { - require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); - profiling_start(); -} - /** * Database connection. Used for all access to the database. * @global moodle_database $DB @@ -597,6 +591,12 @@ ini_set('include_path', $CFG->libdir . '/pear' . PATH_SEPARATOR . ini_get('inclu // Register our classloader. \core\component::register_autoloader(); +// Early profiling start, based exclusively on config.php $CFG settings +if (!empty($CFG->earlyprofilingenabled) && !defined('ABORT_AFTER_CONFIG_CANCEL')) { + require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); + profiling_start(); +} + // Special support for highly optimised scripts that do not need libraries and DB connection. if (defined('ABORT_AFTER_CONFIG')) { if (!defined('ABORT_AFTER_CONFIG_CANCEL')) {