Just fail hard if autoloader can't find class.
This commit is contained in:
parent
5998e7f7d3
commit
ef35c5aeba
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user