Plugins need to be able to load classes from filesystem.
Plugins need to load settings.
Plugins may want to add commands and other stuffs. Not merely event listeners..
Proposition to create a PluginInterface something like:
interface PluginInterface
{
public function loadPlugin($settings); // called with a giroapp settings object
public function getSubscribers(): SubscriberInterface[];
public function getCommands(): CommandInterface[];
// ...
}
Then let plugins be a file in /plugins that return a PluginInterface object. Be it a phar archive or a regular php file.. So the loading mechanism should be something like:
While working with https://github.com/hanneskod/giroapp-mailer-plugin it became clear we need a better plugin system.
PluginInterface
something like:/plugins
that return aPluginInterface
object. Be it a phar archive or a regular php file.. So the loading mechanism should be something like: