2023-11-06 23:46:30 +01:00
|
|
|
<?PHP
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Autoloader for musdb.
|
|
|
|
*
|
|
|
|
* @param string $className Name of the class to load.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
\spl_autoload_register(function(string $className):void {
|
|
|
|
|
|
|
|
// Try using class map as defined through /scripts/buildClassMap.php
|
|
|
|
|
2024-10-10 09:51:28 +02:00
|
|
|
foreach (array_merge([__DIR__ . '/../tests',
|
|
|
|
__DIR__ . '/../src',
|
|
|
|
__DIR__ . '/../src/enums',
|
|
|
|
__DIR__ . '/../../MD_STD/src',
|
|
|
|
__DIR__ . '/../../MDErrorReporter',
|
|
|
|
__DIR__ . '/../../MDErrorReporter/exceptions',
|
|
|
|
__DIR__ . '/../../MDErrorReporter/exceptions/generic',
|
|
|
|
__DIR__ . '/../../MDErrorReporter/exceptions/updates',
|
|
|
|
__DIR__ . '/../../MDMysqli/src',
|
|
|
|
__DIR__ . '/../../MDMysqli/exceptions',
|
|
|
|
]) as $classDir) {
|
2023-11-06 23:46:30 +01:00
|
|
|
|
|
|
|
if (\file_exists("$classDir/$className.php")) {
|
|
|
|
include "$classDir/$className.php";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|