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