Skip to content

Commit

Permalink
Fixes #833 - Allow absolute path when relocating tmp folder outside o…
Browse files Browse the repository at this point in the history
…f Piwik

document root.
  • Loading branch information
vipsoft committed Jun 28, 2009
1 parent 02d07aa commit 960ae5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/global.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
logger_error[] = screen
logger_exception[] = screen

; if configured to log in files, log files will be created in this relative path
; eg. if the value is tmp/logs files will be created in /path/to/piwik/tmp/logs/
logger_file_path = tmp/logs/
; if configured to log in files, log files will be created in this path
; eg. if the value is tmp/logs files will be created in /path/to/piwik/tmp/logs/
logger_file_path = tmp/logs

; all calls to the API (method name, parameters, execution time, caller IP, etc.)
; disabled by default as it can cause serious overhead and should only be used wisely
Expand Down
9 changes: 8 additions & 1 deletion core/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ function __construct( $logToFileFilename,
$logToDatabaseColumnMapping )
{
parent::__construct();
$this->logToFileFilename = PIWIK_INCLUDE_PATH . '/' . Zend_Registry::get('config')->log->logger_file_path . $logToFileFilename;

$log_dir = Zend_Registry::get('config')->log->logger_file_path;
if($log_dir[0] != '/' && $log_dir[0] != DIRECTORY_SEPARATOR)
{
$log_dir = PIWIK_INCLUDE_PATH . '/' . $log_dir;
}
$this->logToFileFilename = $log_dir . '/' . $logToFileFilename;

$this->fileFormatter = $fileFormatter;
$this->screenFormatter = $screenFormatter;
$this->logToDatabaseTableName = Piwik::prefixTable($logToDatabaseTableName);
Expand Down
5 changes: 4 additions & 1 deletion core/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public function setCaching($caching)

static public function addPiwikPath(&$value, $key)
{
$value = PIWIK_INCLUDE_PATH ."/$value";
if($value[0] != '/' && $value[0] != DIRECTORY_SEPARATOR)
{
$value = PIWIK_INCLUDE_PATH ."/$value";
}
}
}

0 comments on commit 960ae5f

Please sign in to comment.