diff options
author | diosmosis <benaka@piwik.pro> | 2015-04-27 00:59:50 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-04-27 00:59:50 +0300 |
commit | db4874776aa839bc8ed1f70bcbd7712acc741746 (patch) | |
tree | 1b374298563c2f2a31228f4ffc5d35b23eb29fad /core/Container | |
parent | 1760412a370823f96eeed21d730acf8f4038c843 (diff) | |
parent | ad93a77498cb03ae8f4c52c292d3b584f67c458e (diff) |
Merge branch 'master' into config_step_2
Conflicts:
core/Console.php
piwik.php
Diffstat (limited to 'core/Container')
-rw-r--r-- | core/Container/ContainerFactory.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/Container/ContainerFactory.php b/core/Container/ContainerFactory.php index 101a9c0aef..bc15fe9e6f 100644 --- a/core/Container/ContainerFactory.php +++ b/core/Container/ContainerFactory.php @@ -111,7 +111,9 @@ class ContainerFactory $file = sprintf('%s/config/environment/%s.php', PIWIK_USER_PATH, $this->environment); - $builder->addDefinitions($file); + if (file_exists($file)) { + $builder->addDefinitions($file); + } } private function addPluginConfigs(ContainerBuilder $builder) @@ -119,13 +121,17 @@ class ContainerFactory $plugins = $this->pluginList->getActivatedPlugins(); foreach ($plugins as $plugin) { - $file = Manager::getPluginsDirectory() . $plugin . '/config/config.php'; + $baseDir = Manager::getPluginsDirectory() . $plugin; - if (! file_exists($file)) { - continue; + $file = $baseDir . '/config/config.php'; + if (file_exists($file)) { + $builder->addDefinitions($file); } - $builder->addDefinitions($file); + $environmentFile = $baseDir . '/config/' . $this->environment . '.php'; + if (file_exists($environmentFile)) { + $builder->addDefinitions($environmentFile); + } } } |