diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-15 00:40:21 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-15 00:40:21 +0400 |
commit | 946cae6e1df8d2e0a5c1fd6a96a3b5f8359b3c91 (patch) | |
tree | 2c96ec9715173b93a9801fc0133e4f40b83f67e4 /plugins/CorePluginsAdmin | |
parent | accb3c9401923806949f6b3429b0bd05c2756af7 (diff) |
refs #6444 just in case this issue is related to Piwik I thought it would be awesome if Piwik could try to repair itself. So whenever we show the safemode we try to delete caches and invalidate files. Maybe there could be more done? Such as resetting some options or so?
Diffstat (limited to 'plugins/CorePluginsAdmin')
-rw-r--r-- | plugins/CorePluginsAdmin/Controller.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 70942c7715..543d42338b 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -334,6 +334,8 @@ class Controller extends Plugin\ControllerAdmin public function safemode($lastError = array()) { + $this->tryToRepairPiwik(); + if (empty($lastError)) { $lastError = array( 'message' => Common::getRequestVar('error_message', null, 'string'), @@ -478,4 +480,13 @@ class Controller extends Plugin\ControllerAdmin return array_keys(SettingsManager::getPluginSettingsForCurrentUser()); } + private function tryToRepairPiwik() + { + // in case any opcaches etc were not cleared after an update for instance. Might prevent from getting the + // error again + try { + Filesystem::deleteAllCacheOnUpdate(); + } catch (Exception $e) {} + } + } |