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:
-rw-r--r--core/Log.php8
-rw-r--r--tests/PHPUnit/TestingEnvironment.php13
2 files changed, 5 insertions, 16 deletions
diff --git a/core/Log.php b/core/Log.php
index a28032be9b..3436497884 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -167,14 +167,6 @@ class Log extends Singleton
*/
protected function __construct()
{
- /**
- * access a property that is not overriden by TestingEnvironment before accessing log as the
- * log section is used in TestingEnvironment. Otherwise access to magic __get('log') fails in
- * TestingEnvironment as it tries to acccess it already here with __get('log').
- * $config->log ==> __get('log') ==> Config.createConfigInstance ==> nested __get('log') ==> returns null
- */
- $initConfigToPreventErrorWhenAccessingLog = Config::getInstance()->mail;
-
$logConfig = Config::getInstance()->log;
$this->setCurrentLogLevelFromConfig($logConfig);
$this->setLogWritersFromConfig($logConfig);
diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index d2e8ad5c76..175f5149a4 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -149,8 +149,7 @@ class Piwik_TestingEnvironment
$config->setTestEnvironment($testingEnvironment->configFileLocal, $testingEnvironment->configFileGlobal, $testingEnvironment->configFileCommon);
if ($testingEnvironment->configFileLocal) {
- unset($cache['General']);
- $config->General['session_save_handler'] = 'dbtable';
+ $local['General']['session_save_handler'] = 'dbtable';
}
$manager = \Piwik\Plugin\Manager::getInstance();
@@ -161,17 +160,15 @@ class Piwik_TestingEnvironment
sort($pluginsToLoad);
- $config->Plugins = array('Plugins' => $pluginsToLoad);
+ $local['Plugins'] = array('Plugins' => $pluginsToLoad);
- $trackerPluginsToLoad = array_filter($config->Plugins['Plugins'], function ($plugin) use ($manager) {
+ $trackerPluginsToLoad = array_filter($local['Plugins']['Plugins'], function ($plugin) use ($manager) {
return $manager->isTrackerPlugin($manager->loadPlugin($plugin));
});
- $config->Plugins_Tracker = array('Plugins_Tracker' => $trackerPluginsToLoad);
+ $local['Plugins_Tracker'] = array('Plugins_Tracker' => $trackerPluginsToLoad);
- $log = $config->log;
- $log['log_writers'] = array('file');
- $config->log = $log;
+ $local['log']['log_writers'] = array('file');
$manager->unloadPlugins();