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
path: root/config
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-04-09 06:36:22 +0300
committerdiosmosis <benaka@piwik.pro>2015-04-09 06:36:22 +0300
commit67829227ce2d0c4473466acbc42118a7a150b14c (patch)
tree973ebb1b5aa30d0b47a8d14ce73b7524a4051be0 /config
parent47e7d3a74c6b13431e489d2d652af53410f880ad (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.php10
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')),
-
);