diff options
author | Benaka <diosmosis@users.noreply.github.com> | 2017-09-26 01:23:18 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-09-26 01:23:18 +0300 |
commit | da6e68b04ff532d125e2c1e38be23814c5b8ecd9 (patch) | |
tree | fcdd5c46e85f3373a7c69378f85cc195339f3090 /core | |
parent | 5819e6ef2441d00115dac633e8a9845e2a2690a6 (diff) |
Adding new events triggered when dynamic files are changed by Piwik. (#12106)
* Adding new events triggered when dynamic files are changed by Piwik.
* Fixing broken test in TrackerUpdaterTest.php.
Diffstat (limited to 'core')
-rw-r--r-- | core/Config.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/Config.php b/core/Config.php index b23c2a810a..3da4d2541d 100644 --- a/core/Config.php +++ b/core/Config.php @@ -381,17 +381,25 @@ class Config if ($output !== null && $output !== false ) { + $localPath = $this->getLocalPath(); if ($this->doNotWriteConfigInTests) { // simulate whether it would be successful - $success = is_writable($this->getLocalPath()); + $success = is_writable($localPath); } else { - $success = @file_put_contents($this->getLocalPath(), $output); + $success = @file_put_contents($localPath, $output); } if ($success === false) { throw $this->getConfigNotWritableException(); } + + /** + * Triggered when a INI config file is changed on disk. + * + * @param string $localPath Absolute path to the changed file on the server. + */ + Piwik::postEvent('Core.configFileChanged', [$localPath]); } if ($clear) { |