-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Introduce new events Updater.componentUpdated, PluginManager.pluginInstalled, PluginManager.pluginUninstalled #10468
Changes from 3 commits
82d811b
b300a6d
b616357
27078cb
11e27e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,6 +279,15 @@ public function update($componentName) | |
|
||
$this->executeListenerHook('onComponentUpdateFinished', array($componentName, $updatedVersion, $warningMessages)); | ||
|
||
/** | ||
* Event triggered after a component has been updated. | ||
* | ||
* @param string $componentName 'core', or plugin name | ||
* @param string $updatedVersion version updated to | ||
* @param array $warningMessages warnings occurred during update | ||
*/ | ||
Piwik::postEvent('Updater.componentUpdated', array($componentName, $updatedVersion, $warningMessages)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An example on how to use it might be useful. Also an example maybe for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the current implementation doesn't use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be tempted to remove the observer completely and to replace it. It's not really "the Piwik way" and seems bit unneeded/over-engineered. However, there might be some benefits of having it so let's just leave it. I was then wondering if we could use the observer/hook instead of the event but I think it's better to have the event as this is API 👍 |
||
|
||
return $warningMessages; | ||
} | ||
|
||
|
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.
For consistency with pluginunistalled, does it make sense to use
$pluginName
here as well? if $plugin is needed, could use it as a second param.The docs need to be adjusted as it is currently
Plugin $plugin
notstring $pluginName
.Maybe we could also add an example to all the new events with an example use case? We have this for many other events and it will be possible on the developer site.
Should we mention that this event may be triggered several times when the config file is not writable?
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.
I'll change that. plugin name should be fine. Will also mention that it could be triggered multiple times.
The other events for de-/activating plugins don't have use case comments. Aren't those events self explaining?
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.
I reckon they are self explaining 👍