mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
PluginManager: Automatically create data directories for plugins (#2284)
This commit is contained in:
parent
90bf94f8f7
commit
40c28f4d26
@ -256,9 +256,7 @@ abstract class PluginBase implements Plugin{
|
||||
}
|
||||
|
||||
public function reloadConfig(){
|
||||
if(!$this->saveDefaultConfig()){
|
||||
@mkdir($this->dataFolder);
|
||||
}
|
||||
$this->saveDefaultConfig();
|
||||
$this->config = new Config($this->configFile);
|
||||
if(($configStream = $this->getResource("config.yml")) !== null){
|
||||
$this->config->setDefaults(yaml_parse(Config::fixYAMLIndexes(stream_get_contents($configStream))));
|
||||
|
@ -181,6 +181,9 @@ class PluginManager{
|
||||
$this->server->getLogger()->error("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory");
|
||||
return null;
|
||||
}
|
||||
if(!file_exists($dataFolder)){
|
||||
mkdir($dataFolder, 0777, true);
|
||||
}
|
||||
|
||||
$prefixed = $loader->getAccessProtocol() . $path;
|
||||
$loader->loadPlugin($prefixed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user