◆ __construct()
- Parameters
-
51 $this->server = $server;
◆ disablePlugin()
disablePlugin |
( |
Plugin |
$plugin | ) |
|
- Parameters
-
Implements PluginLoader.
147 if($plugin instanceof PluginBase and $plugin->isEnabled()){
152 $plugin->setEnabled(
false);
◆ enablePlugin()
enablePlugin |
( |
Plugin |
$plugin | ) |
|
- Parameters
-
Implements PluginLoader.
134 if($plugin instanceof PluginBase and !$plugin->isEnabled()){
137 $plugin->setEnabled(
true);
◆ getPluginDescription()
getPluginDescription |
( |
|
$file | ) |
|
Gets the PluginDescription from the file
- Parameters
-
- Returns
- PluginDescription
Implements PluginLoader.
100 if(is_dir($file) and file_exists($file .
"/plugin.yml")){
101 $yaml = @file_get_contents($file .
"/plugin.yml");
103 return new PluginDescription($yaml);
◆ getPluginFilters()
Returns the filename patterns that this loader accepts
- Returns
- array|string
Implements PluginLoader.
◆ loadPlugin()
Loads the plugin contained in $file
- Parameters
-
- Returns
- Plugin
Implements PluginLoader.
62 if(is_dir($file) and file_exists($file .
"/plugin.yml") and file_exists($file .
"/src/")){
65 $dataFolder = dirname($file) . DIRECTORY_SEPARATOR . $description->getName();
66 if(file_exists($dataFolder) and !is_dir($dataFolder)){
67 trigger_error(
"Projected dataFolder '" . $dataFolder .
"' for " . $description->getName() .
" exists and is not a directory", E_USER_WARNING);
73 $className = $description->getMain();
74 $this->server->getLoader()->addPath($file .
"/src");
76 if(class_exists($className,
true)){
77 $plugin =
new $className();
78 $this->initPlugin($plugin, $description, $dataFolder, $file);
82 trigger_error(
"Couldn't load source plugin " . $description->getName() .
": main class not found", E_USER_WARNING);
The documentation for this class was generated from the following file:
- src/pocketmine/plugin/FolderPluginLoader.php