mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added class not found exception to SplClassLoader
This commit is contained in:
parent
5da68059ee
commit
ee6dc989ce
@ -130,7 +130,11 @@ class SplClassLoader implements SplAutoloader{
|
||||
*/
|
||||
public function load($resourceName){
|
||||
$resourceAbsolutePath = $this->getResourceAbsolutePath($resourceName);
|
||||
|
||||
if($resourceAbsolutePath == ""){
|
||||
throw new \RuntimeException(
|
||||
sprintf('Autoloader couldn\'t find a file to include for %s', $resourceName)
|
||||
);
|
||||
}
|
||||
switch(true){
|
||||
case ($this->mode & self::MODE_SILENT):
|
||||
if($resourceAbsolutePath !== false){
|
||||
@ -140,13 +144,7 @@ class SplClassLoader implements SplAutoloader{
|
||||
|
||||
case ($this->mode & self::MODE_NORMAL):
|
||||
default:
|
||||
if(!file_exists($resourceAbsolutePath)){
|
||||
throw new \RuntimeException(
|
||||
sprintf('Autoloader expected in file "%s" to exist.', $resourceAbsolutePath)
|
||||
);
|
||||
}else{
|
||||
require $resourceAbsolutePath;
|
||||
}
|
||||
require $resourceAbsolutePath;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user