MDL-82747 core: Provide a standard way to register the Autoloader

This commit is contained in:
Andrew Nicols
2024-08-14 21:59:52 +08:00
parent fcf23db6be
commit 734a5f1e80
5 changed files with 26 additions and 21 deletions
+2 -6
View File
@@ -615,12 +615,8 @@ if (!empty($_SERVER['HTTP_X_moz']) && $_SERVER['HTTP_X_moz'] === 'prefetch'){
//the problem is that we need specific version of quickforms and hacked excel files :-(
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}
// Register our classloader.
\core_component::register_autoloader();
// Remember the default PHP timezone, we will need it later.
core_date::store_default_php_timezone();