Added file_exists check to SplClassLoader

This commit is contained in:
Shoghi Cervantes 2014-04-03 13:59:26 +02:00
parent 5052e58bd0
commit 5da68059ee

View File

@ -140,7 +140,13 @@ class SplClassLoader implements SplAutoloader{
case ($this->mode & self::MODE_NORMAL):
default:
require $resourceAbsolutePath;
if(!file_exists($resourceAbsolutePath)){
throw new \RuntimeException(
sprintf('Autoloader expected in file "%s" to exist.', $resourceAbsolutePath)
);
}else{
require $resourceAbsolutePath;
}
break;
}