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
Adding new events triggered when dynamic files are changed by Piwik. #12106
Conversation
plugins/CoreAdminHome/CustomLogo.php
Outdated
* @param bool $isSmall If true, the path is for the small logo image, otherwise the | ||
* full image. | ||
*/ | ||
Piwik::postEvent('CoreAdminHome.customLogoChanged', [$rootPath . '/' . $smallLogoUserPath, $isSmall = true]); |
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.
Looks good to me. Maybe, instead of isSmall:true|false
could post something like size=small
? Would just allow us to more easily post more events in the future in case we have other sizes.
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 just see below the favicon event... could event have like size=small|large|favicon
maybe? Then some constants for those values for easy checking.
@@ -130,6 +131,8 @@ public function update() | |||
|
|||
if ($newContent !== $this->getCurrentTrackerFileContent()) { | |||
$this->toFile->save($newContent); | |||
|
|||
Piwik::postEvent('CustomPiwikJs.piwikJsChanged', [$this->toFile->getPath()]); |
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.
Can maybe add a little documentation here?
Added 2 small comments but looks good otherwise 👍 |
@tsteur Made the requested changes. |
PR looks good to me. I would probably renamed one event to FYI: We will need to see what kind of documentation it generates on https://developer.piwik.org/api-reference/events#controllermoduleaction for that event (once merged) as I don't remember whether we need some kind of extra logic for that on the developer website or not. |
I was going by the text in your comment. Is there a documented convention?
Not needed for what I'm doing, just figured I'd be thorough. |
There is no convention for this. If it is not needed, I would maybe remove the event though. |
Removed the |
Added a couple new events that are triggered when changes are made to dynamic files on a Piwik server. The events include:
Core.configFileChanged
: triggered when an INI config file is changedCoreAdminHome.customLogoChanged
: triggered when a custom logo/favicon file is updatedCustomPiwikJs.piwikJsChanged
: triggered when tracker JS is regenerated & saved