mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-03 18:38:31 +03:00
Add PluginInfo::getInstance method
This commit is contained in:
parent
a4361fe8ce
commit
f7434502b7
@ -94,8 +94,8 @@ class PluginInfo
|
||||
* Returns dependencies of the plugin.
|
||||
*
|
||||
* @return array Dependencies list. See
|
||||
* {@link \Mibew\Plugin\PluginInterface::getDependencies()} for detail of
|
||||
* array structure.
|
||||
* {@link \Mibew\Plugin\PluginInterface::getDependencies()} for details of
|
||||
* the array structure.
|
||||
*/
|
||||
public function getDependencies()
|
||||
{
|
||||
@ -119,4 +119,18 @@ class PluginInfo
|
||||
|
||||
return $dependent_plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the plugin.
|
||||
*
|
||||
* @param array $configs Configurations array that will be passed to
|
||||
* plugin's constructor.
|
||||
* @return \Mibew\Plugin\PluginInterface
|
||||
*/
|
||||
public function getInstance($configs = array())
|
||||
{
|
||||
$plugin_class = $this->getClass();
|
||||
|
||||
return new $plugin_class($configs);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user