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:
Diffstat (limited to 'config/global.php')
-rw-r--r--config/global.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/config/global.php b/config/global.php
index 36e04970aa..cd10f72370 100644
--- a/config/global.php
+++ b/config/global.php
@@ -45,10 +45,17 @@ return array(
return $cache;
},
'Piwik\Cache\Backend' => function (ContainerInterface $c) {
- try {
- $backend = $c->get('ini.Cache.backend');
- } catch (NotFoundException $ex) {
- $backend = 'chained'; // happens if global.ini.php is not available
+ // If Piwik is not installed yet, it's possible the tmp/ folder is not writable
+ // we prevent failing with an unclear message eg. coming from doctrine-cache
+ // by forcing to use a cache backend which always works ie. array
+ if(!\Piwik\SettingsPiwik::isPiwikInstalled()) {
+ $backend = 'array';
+ } else {
+ try {
+ $backend = $c->get('ini.Cache.backend');
+ } catch (NotFoundException $ex) {
+ $backend = 'chained'; // happens if global.ini.php is not available
+ }
}
return \Piwik\Cache::buildBackend($backend);