MyBB Community Forums

Full Version: Plugin Dependencies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Plugin dependencies should definitely be added to MyBB so plugin makers can make plugins that extend an existing plugin, and allow users to only install their plugin if the plugin it is dependent on is already installed & activated.
that is up the plugin authors. the author of a plugin can check if a required plugin is already active rather easily.

also, anyone can add hooks to their plugins, but if not required, they should not be used due to performance impacts. The MyShowcase plugin that I released has custom hooks in many of the functions so that it can be extended if wanted.
I know you could check it pretty easily, but what would be the harm in adding a 'dependencies' option in the _info() function where you can list plugins that are required, and then display the required plugins that are not installed. This could prevent a lot of errors caused by plugins that require another plugin, not just extending the first plugin.
but are the dependencies requiring an "active" plugin or just that the files exist? For example, Patches requires the PluginLibrary, but you can not activate PL. it only checks if it exists. So your dependencies features would have to be two part, "active" and simply "exists".
or maybe just a 'dependencies' part and have an asterisk by ones that are required to be active such as:
"dependencies" => "plugin1, plugin2*, plugin3",

or something like that? just make sure that field doesn't accept wildcards.
This could lead to all kinds of inconsistencies. Isn't it easier for a plugin author to create a hook in a plugin which dependent plugins could check for?
(2011-09-27, 07:44 PM)pavemen Wrote: [ -> ]that is up the plugin authors. the author of a plugin can check if a required plugin is already active rather easily.

also, anyone can add hooks to their plugins, but if not required, they should not be used due to performance impacts. The MyShowcase plugin that I released has custom hooks in many of the functions so that it can be extended if wanted.
My social groups plugin I designed utilizes hooks so a member can add more functionality if they needed it while they wait for me to do an update. The next update I'll add documentation on what hooks I have.

(2011-09-28, 02:31 AM)dragonexpert Wrote: [ -> ]My social groups plugin I designed utilizes hooks so a member can add more functionality if they needed it while they wait for me to do an update. The next update I'll add documentation on what hooks I have.

I think that if the plugin is large or impacts other areas or has the potential to be extended, then the plugin author is smart to add hooks. However, adding hook does have a resource impact so they need to be used sparingly/smartly. I have not seen the plugin you mention to have any feedback on it.