Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-10-15 00:40:21 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-10-15 00:40:21 +0400
commit946cae6e1df8d2e0a5c1fd6a96a3b5f8359b3c91 (patch)
tree2c96ec9715173b93a9801fc0133e4f40b83f67e4 /plugins/CorePluginsAdmin
parentaccb3c9401923806949f6b3429b0bd05c2756af7 (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.php11
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) {}
+ }
+
}