mirror of
https://github.com/Mibew/mibew.git
synced 2025-06-03 23:56:15 +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.
|
* Returns dependencies of the plugin.
|
||||||
*
|
*
|
||||||
* @return array Dependencies list. See
|
* @return array Dependencies list. See
|
||||||
* {@link \Mibew\Plugin\PluginInterface::getDependencies()} for detail of
|
* {@link \Mibew\Plugin\PluginInterface::getDependencies()} for details of
|
||||||
* array structure.
|
* the array structure.
|
||||||
*/
|
*/
|
||||||
public function getDependencies()
|
public function getDependencies()
|
||||||
{
|
{
|
||||||
@ -119,4 +119,18 @@ class PluginInfo
|
|||||||
|
|
||||||
return $dependent_plugins;
|
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