Skip to content
Extraits de code Groupes Projets
Valider 30ac0fa4 rédigé par mattab's avatar mattab
Parcourir les fichiers

Always report an error if config file not writable. Not sure where this logic came from...

parent 705f29cb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -260,26 +260,22 @@ class Config extends Singleton ...@@ -260,26 +260,22 @@ class Config extends Singleton
public function init() public function init()
{ {
$this->initialized = true; $this->initialized = true;
$reportError = !empty($GLOBALS['PIWIK_TRACKER_MODE']);
// read defaults from global.ini.php // read defaults from global.ini.php
if (!is_readable($this->pathGlobal) && $reportError) { if (!is_readable($this->pathGlobal)) {
Piwik_ExitWithMessage(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathGlobal))); Piwik_ExitWithMessage(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathGlobal)));
} }
$this->configGlobal = _parse_ini_file($this->pathGlobal, true); $this->configGlobal = _parse_ini_file($this->pathGlobal, true);
if (empty($this->configGlobal)) {
if (empty($this->configGlobal) && $reportError) {
Piwik_ExitWithMessage(Piwik::translate('General_ExceptionUnreadableFileDisabledMethod', array($this->pathGlobal, "parse_ini_file()"))); Piwik_ExitWithMessage(Piwik::translate('General_ExceptionUnreadableFileDisabledMethod', array($this->pathGlobal, "parse_ini_file()")));
} }
$this->configCommon = _parse_ini_file($this->pathCommon, true); $this->configCommon = _parse_ini_file($this->pathCommon, true);
if ($reportError) { $this->checkLocalConfigFound();
$this->checkLocalConfigFound();
}
$this->configLocal = _parse_ini_file($this->pathLocal, true); $this->configLocal = _parse_ini_file($this->pathLocal, true);
if (empty($this->configLocal) && $reportError) { if (empty($this->configLocal)) {
Piwik_ExitWithMessage(Piwik::translate('General_ExceptionUnreadableFileDisabledMethod', array($this->pathLocal, "parse_ini_file()"))); Piwik_ExitWithMessage(Piwik::translate('General_ExceptionUnreadableFileDisabledMethod', array($this->pathLocal, "parse_ini_file()")));
} }
} }
...@@ -292,7 +288,7 @@ class Config extends Singleton ...@@ -292,7 +288,7 @@ class Config extends Singleton
public function checkLocalConfigFound() public function checkLocalConfigFound()
{ {
if (!$this->existsLocalConfig()) { if (!$this->existsLocalConfig()) {
throw new Exception(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathLocal))); Piwik_ExitWithMessage(Piwik::translate('General_ExceptionConfigurationFileNotFound', array($this->pathLocal)));
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter