Just fail hard if autoloader can't find class.

This commit is contained in:
Greg Sarjeant 2025-06-30 08:49:56 -04:00
parent 5998e7f7d3
commit ef35c5aeba

View File

@ -24,17 +24,13 @@ function autoloader($className) {
RecursiveIteratorIterator::LEAVES_ONLY
);
// I'm just going to let this fail hard if a requested class doesn't exist.
foreach ($files as $file) {
if ($file->getFilename() === $classFilename) {
include_once $file->getPathname();
return;
}
}
throw new SetupException(
"Could not load Class $className: " . $e->getMessage(),
'load_classes'
);
}
// Register the autoloader