Skip to content

Commit

Permalink
Fix erfurt log path to match new directory structure
Browse files Browse the repository at this point in the history
- since log folder is now on the same level as library, the log path needs to be
  adjusted accordingly
- test case adapted
  • Loading branch information
Philipp Frischmuth committed Sep 6, 2012
1 parent 8db3ba4 commit 199302d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Makefile
Expand Up @@ -112,22 +112,22 @@ cs-check-blame:

# test stuff

test-unit:
test-unit: directories
@cd tests && phpunit --bootstrap Bootstrap.php unit/

test-unit-cc:
test-unit-cc: directories
@cd tests/unit && phpunit

test-integration-virtuoso:
test-integration-virtuoso: directories
@cd tests && EF_STORE_ADAPTER=virtuoso phpunit --bootstrap Bootstrap.php integration/

test-integation-virtuoso-cc:
test-integation-virtuoso-cc: directories
@cd tests/integration && EF_STORE_ADAPTER=virtuoso phpunit

test-integration-mysql:
test-integration-mysql: directories
@cd tests && EF_STORE_ADAPTER=zenddb phpunit --bootstrap Bootstrap.php integration/

test-integation-mysql-cc:
test-integation-mysql-cc: directories
@cd tests/integration && EF_STORE_ADAPTER=zenddb phpunit

test:
Expand Down
4 changes: 2 additions & 2 deletions library/Erfurt/App.php
Expand Up @@ -811,15 +811,15 @@ public function getLogDir()
if (isset($config->log->path)) {
$matches = array();
if (!(preg_match('/^(\w:[\/|\\\\]|\/)/', $config->log->path, $matches) === 1)) {
$config->log->path = EF_BASE . $config->log->path;
$config->log->path = realpath(EF_BASE . '../../' . $config->log->path);
}

$config->log->path = rtrim($config->log->path, '/\\') . '/';

if (is_writable($config->log->path)) {
return $config->log->path;
} else {
error_log('Attention : Erfurt log.path ('. $config->log->path .') not writable.');
error_log('Attention : Erfurt log.path ('. $config->log->path .') not writable.');
return false;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Erfurt/AppTest.php
Expand Up @@ -366,7 +366,7 @@ public function testGetLogDir()
$config = $app->getConfig();

$config->log->path = 'logs';
$expectedPath = false;
$expectedPath = realpath(EF_BASE . '../../logs') . '/';
$resolvedPath = $app->getLogDir();
$this->assertEquals($expectedPath, $resolvedPath);

Expand Down

0 comments on commit 199302d

Please sign in to comment.