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:
authormattab <matthieu.aubry@gmail.com>2015-02-20 05:52:49 +0300
committermattab <matthieu.aubry@gmail.com>2015-02-20 05:52:49 +0300
commitec9ba8d3e6567c87f1c8020f9726b9c5e66dcf2a (patch)
tree8bf8782a9eec2eaacb51e6f64addfc8b75c6116d /core/Config.php
parent1504ebb398eb670f146e1eefadec1eb7979dccb9 (diff)
Clearing the config in init() which can be called multiple times
Diffstat (limited to 'core/Config.php')
-rw-r--r--core/Config.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/Config.php b/core/Config.php
index d1d1c680a4..eff1723a94 100644
--- a/core/Config.php
+++ b/core/Config.php
@@ -126,8 +126,6 @@ class Config extends Singleton
$this->isTest = true;
}
- $this->clear();
-
$this->pathLocal = $pathLocal ?: Config::getLocalConfigPath();
$this->pathGlobal = $pathGlobal ?: Config::getGlobalConfigPath();
$this->pathCommon = $pathCommon ?: Config::getCommonConfigPath();
@@ -281,8 +279,9 @@ class Config extends Singleton
{
$hostConfig = self::getLocalConfigInfoForHostname($hostname);
- if (!Filesystem::isValidFilename($hostConfig['file'])) {
- throw new Exception('Hostname is not valid');
+ $filename = $hostConfig['file'];
+ if (!Filesystem::isValidFilename($filename)) {
+ throw new Exception('Piwik domain is not a valid looking hostname (' . $filename . ').');
}
$this->pathLocal = $hostConfig['path'];
@@ -308,6 +307,7 @@ class Config extends Singleton
{
$this->configGlobal = array();
$this->configLocal = array();
+ $this->configCommon = array();
$this->configCache = array();
$this->initialized = false;
}
@@ -319,6 +319,7 @@ class Config extends Singleton
*/
public function init()
{
+ $this->clear();
$this->initialized = true;
$reportError = SettingsServer::isTrackerApiRequest();