HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
hooks request
Hello
I am trying to do a plugin that would hook before a plugin is enable and checks all its dependencies recursively and enables them automatically. Unfortunatelly there is absolutely no event that fires before a plugin is enabled (only after it is) which is kind of the main nail in this plugin's coffin
Therefore, I would need an event before an event is enabled, actually, it would be even better before the plugin is even tested for requirements
in: /library/core/class.pluginmanager.php on line 583, something like
or in: /applications/dashboard/controllers/class.settingscontroller.php on line 636, something like:
Also, I intend on making this check for requirements for applications. I know they don't have application requirements as plugins should depend on applications and not the other way around, but sometimes you have a set of plugins that you need to use for multiple applications and you want to make sure that it is enabled before you want to enable your application.
So is it possible that for the next version release to have the hook(s) and maybe also some dependencies for applications just like plugins have?
Thanks
I am trying to do a plugin that would hook before a plugin is enable and checks all its dependencies recursively and enables them automatically. Unfortunatelly there is absolutely no event that fires before a plugin is enabled (only after it is) which is kind of the main nail in this plugin's coffin
Therefore, I would need an event before an event is enabled, actually, it would be even better before the plugin is even tested for requirements
in: /library/core/class.pluginmanager.php on line 583, something like
$this->FireEvent('BeforeTestPlugin');
or in: /applications/dashboard/controllers/class.settingscontroller.php on line 636, something like:
$this->FireEvent('BeforeTestAddon');
Also, I intend on making this check for requirements for applications. I know they don't have application requirements as plugins should depend on applications and not the other way around, but sometimes you have a set of plugins that you need to use for multiple applications and you want to make sure that it is enabled before you want to enable your application.
So is it possible that for the next version release to have the hook(s) and maybe also some dependencies for applications just like plugins have?
Thanks
Tagged:
1
Comments
Applications do support the 'RequiredApplications' property already.
public function TestPlugin( ... ){ $this->FireEvent('BeforeTestPlugin'); // Make sure...
in class.settingscontroller.php
try{ $this->FireEvent('BeforeTestAddon'); $AddonManager->$TestMethod( ... );
Or choose any other name that you think it suits better
As for the applications, could also a "RequiredPlugins" property be implemented as well as it would be useful?
The reason I'm asking for this is that we are developing several applications that make use of some common functionalities which we would like to make into global plugins and assign them to those applications instead of having an installation of each of them into every application.
Also, you can have a priority management system for conflict situations: aka, if a plugin and an application require each-other, the application has priority but would shoot out a warning message.