mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Improved plugin loading
This commit is contained in:
parent
adcbc67a71
commit
0d91be62cf
@ -58,7 +58,7 @@ class PharPluginLoader implements PluginLoader{
|
||||
}
|
||||
$file = "phar://$file";
|
||||
$className = $description->getMain();
|
||||
$this->server->getLoader()->add(substr($className, 0, strpos($className, "\\")), array(
|
||||
$this->server->getLoader()->add(substr($className, 0, strrpos($className, "\\")), array(
|
||||
"$file/src"
|
||||
));
|
||||
|
||||
|
@ -122,7 +122,15 @@ class SplClassLoader implements SplAutoloader{
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function add($resource, $resourcePath = null){
|
||||
$this->resources[$resource] = (array) $resourcePath;
|
||||
if(isset($this->resources[$resource])){
|
||||
foreach((array) $resourcePath as $path){
|
||||
if(!in_array($path, $this->resources[$resource], true)){
|
||||
$this->resources[$resource][] = $path;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$this->resources[$resource] = (array) $resourcePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user