-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Install Scripts #233
Conversation
* added a hook for the footer right before the </body> tag
* Allow plugin to register an installer script callback in init.php * Check for callback when activating a plugin and run * Closes #222
// Does the plugin have an installer script? | ||
if ( isset(self::$_installers[$plugin]) ) | ||
{ | ||
call_user_func(self::$_installers[$plugin]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception handling (and logging) where execution of the callback is unsuccessful.
I also think the return value should be of type bool
as opposed to void
- for convenience of writing a unit test for this method
I think we should have a |
Adding on to keeping track of plugins that are installed, I would suggest rather than automatically installing on enable, the plugin must be installed before being enabled. Put an "Install" button where the enable checkbox is if the plugin has yet to be installed. This would allow plugins to have a graphical install for configuration options if they chose to. |
* Added exception handling for the installer callback * Added a `plugin_installed` column on the plugins table so that the install is not called every time the plugin is enabled/disabled * `Swiftriver_Plugins::install()` returns bool
Added exception handling and |
LGTM |
Plugin Install Scripts closes #233
Example init.php:
Example Callback: