Skip to content

Commit

Permalink
Remove debugging code, remove no longer needed property from config.i…
Browse files Browse the repository at this point in the history
…ni.travis.php, and always check if the local config.ini.php file exists.
  • Loading branch information
diosmosis committed Mar 3, 2014
1 parent 85fb9a4 commit 0195bb5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
14 changes: 3 additions & 11 deletions core/Config.php
Expand Up @@ -167,16 +167,9 @@ public static function getLocalConfigPath()
{
$path = self::getByDomainConfigPath();
if ($path) {
$fd = fopen(PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.log', 'a');
fwrite($fd, "Found config by domain '$path'.");
fclose($fd);
return $path;
}
$r = PIWIK_USER_PATH . self::$defaultLocalConfigPath;
$fd = fopen(PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.log', 'a');
fwrite($fd, "Found config file local path: '$r'.");
fclose($fd);
return $r;
return PIWIK_USER_PATH . self::$defaultLocalConfigPath;
}

private static function getLocalConfigInfoForHostname($hostname)
Expand Down Expand Up @@ -298,9 +291,8 @@ public function init()

$this->configCommon = _parse_ini_file($this->pathCommon, true);

if ($reportError) {
$this->checkLocalConfigFound();
}
$this->checkLocalConfigFound();

$this->configLocal = _parse_ini_file($this->pathLocal, true);
if (empty($this->configLocal) && $reportError) {
Piwik_ExitWithMessage(Piwik::translate('General_ExceptionUnreadableFileDisabledMethod', array($this->pathLocal, "parse_ini_file()")));
Expand Down
2 changes: 1 addition & 1 deletion core/FrontController.php
Expand Up @@ -213,7 +213,7 @@ static public function createConfigObject()
{
$exceptionToThrow = false;
try {
Config::getInstance();
Config::getInstance()->database; // access property to check if the local file exists
} catch (Exception $exception) {

/**
Expand Down
3 changes: 0 additions & 3 deletions tests/PHPUnit/TestingEnvironment.php
Expand Up @@ -86,9 +86,6 @@ public static function addHooks()
$testingEnvironment = new Piwik_TestingEnvironment();

if ($testingEnvironment->configFileLocal) {
$fd = fopen(PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.log', 'a');
fwrite($fd, "Found config file local environment override.");
fclose($fd);
\Piwik\Config::$defaultLocalConfigPath = $testingEnvironment->configFileLocal;
}

Expand Down
3 changes: 0 additions & 3 deletions tests/PHPUnit/config.ini.travis.php
Expand Up @@ -22,6 +22,3 @@
[log]
log_writers[] = file
log_level = debug

[Tests]
persist_fixture_data = 1
2 changes: 0 additions & 2 deletions tests/lib/screenshot-testing/run-tests.js
Expand Up @@ -27,8 +27,6 @@ if (options['help']) {
app.printHelpAndExit();
}

options['tests'] = ['Installation']; // TODO: remove after debugging testing done

app.init();
app.loadTestModules();
app.runTests();

0 comments on commit 0195bb5

Please sign in to comment.