diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-09-30 02:03:13 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-09-30 02:03:13 +0300 |
commit | 43bd151e711d5c719cf89d2746c23da5e29dd264 (patch) | |
tree | af3c4969a64f759811a08c026b739b3d8e716435 /config | |
parent | 68fea796ef5a81cf7c5f4fb17508968ac898bb7c (diff) | |
parent | 7d115b50ecb1660175e64e4e546c72546fd56d69 (diff) |
Merge branch '2.x-dev' into 3.0-m09
Diffstat (limited to 'config')
-rw-r--r-- | config/global.php | 15 |
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); |