diff options
author | diosmosis <benaka@piwik.pro> | 2015-04-09 06:36:22 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-04-09 06:36:22 +0300 |
commit | 67829227ce2d0c4473466acbc42118a7a150b14c (patch) | |
tree | 973ebb1b5aa30d0b47a8d14ce73b7524a4051be0 /config | |
parent | 47e7d3a74c6b13431e489d2d652af53410f880ad (diff) |
Added environment validation system test (mostly failing) that tests Piwik's behavior when INI files are gone or corrupt from each Piwik endpoint (tracker/reporting UI/console). Hacked test code to make it possible and for some tests to pass.
Diffstat (limited to 'config')
-rw-r--r-- | config/global.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/config/global.php b/config/global.php index aff73fcdba..0cb88f5b3d 100644 --- a/config/global.php +++ b/config/global.php @@ -1,6 +1,7 @@ <?php use Interop\Container\ContainerInterface; +use Interop\Container\Exception\NotFoundException; use Piwik\Cache\Eager; use Piwik\SettingsServer; @@ -44,7 +45,13 @@ return array( return $cache; }, 'Piwik\Cache\Backend' => function (ContainerInterface $c) { - return \Piwik\Cache::buildBackend($c->get('ini.Cache.backend')); + 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); }, 'cache.eager.cache_id' => function () { return 'eagercache-' . str_replace(array('.', '-'), '', \Piwik\Version::VERSION) . '-'; @@ -54,5 +61,4 @@ return array( 'Piwik\Translation\Loader\LoaderInterface' => DI\object('Piwik\Translation\Loader\LoaderCache') ->constructor(DI\link('Piwik\Translation\Loader\JsonFileLoader')), - ); |