Project

General

Profile

Feature #14203 » 0000159-class.tslib_fe.diff

Administrator Admin, 2004-07-05 16:35

View differences:

typo3/sysext/cms/tslib/class.tslib_fe.php 2004-07-05 16:30:26.000000000 +0200
// STAT:
$theLogFile = $this->TYPO3_CONF_VARS['FE']['logfile_dir'].$this->config['config']['stat_apache_logfile'];
// Add PATH_site left to $theLogFile if the path is not absolute yet
if(!ereg("^/", $theLogFile)) $theLogFile = PATH_site.$theLogFile;
if ($this->config['config']['stat_apache'] &&
$this->config['config']['stat_apache_logfile'] &&
!strstr($this->config['config']['stat_apache_logfile'],'/') &&
@is_dir($this->TYPO3_CONF_VARS['FE']['logfile_dir']) && @is_file($theLogFile) && @is_writeable($theLogFile)) {
$this->config['stat_vars']['logFile'] = $theLogFile;
$shortTitle = substr(ereg_replace('[^\.[:alnum:]_-]','_',$this->page['title']),0,30);
$pageName = $this->config['config']['stat_apache_pagenames'] ? $this->config['config']['stat_apache_pagenames'] : '[path][title]--[uid].html';
$pageName = str_replace('[title]', $shortTitle ,$pageName);
$pageName = str_replace('[uid]',$this->page['uid'],$pageName);
$pageName = str_replace('[alias]',$this->page['alias'],$pageName);
$pageName = str_replace('[type]',$this->page['type'],$pageName);
$temp = $this->config['rootLine'];
array_pop($temp);
$len = t3lib_div::intInRange($this->config['config']['stat_titleLen'],1,100,20);
$pageName = str_replace('[path]', ereg_replace('[^\.[:alnum:]\/_-]','_',$this->sys_page->getPathFromRootline($temp,$len)).'/' ,$pageName);
$this->config['stat_vars']['pageName'] = $pageName;
!strstr($this->config['config']['stat_apache_logfile'],'/')) {
if(@is_dir($this->TYPO3_CONF_VARS['FE']['logfile_dir']) && @is_file($theLogFile) && @is_writeable($theLogFile)) {
$this->config['stat_vars']['logFile'] = $theLogFile;
$shortTitle = substr(ereg_replace('[^\.[:alnum:]_-]','_',$this->page['title']),0,30);
$pageName = $this->config['config']['stat_apache_pagenames'] ? $this->config['config']['stat_apache_pagenames'] : '[path][title]--[uid].html';
$pageName = str_replace('[title]', $shortTitle ,$pageName);
$pageName = str_replace('[uid]',$this->page['uid'],$pageName);
$pageName = str_replace('[alias]',$this->page['alias'],$pageName);
$pageName = str_replace('[type]',$this->page['type'],$pageName);
$temp = $this->config['rootLine'];
array_pop($temp);
$len = t3lib_div::intInRange($this->config['config']['stat_titleLen'],1,100,20);
$pageName = str_replace('[path]', ereg_replace('[^\.[:alnum:]\/_-]','_',$this->sys_page->getPathFromRootline($temp,$len)).'/' ,$pageName);
$this->config['stat_vars']['pageName'] = $pageName;
} else {
$GLOBALS['TT']->push('Could not set config array for statistic. (check logfile and permissions)','');
}
}
$this->config['FEData'] = $this->tmpl->setup['FEData'];
$this->config['FEData.'] = $this->tmpl->setup['FEData.'];
......
switch($this->TYPO3_CONF_VARS['FE']['logfile_write']) {
case 'fputs':
$GLOBALS['TT']->push('Write to log file (fputs)');
$logfilehandle = fopen(PATH_site.$this->config['stat_vars']['logFile'], 'a');
$logfilehandle = fopen($this->config['stat_vars']['logFile'], 'a');
fputs($logfilehandle, $LogLine."\n");
@fclose($logfilehandle);
$GLOBALS['TT']->pull();
break;
default:
$GLOBALS['TT']->push('Write to log file (echo)');
$execCmd = 'echo "'.addslashes($LogLine).'" >> '.PATH_site.$this->config['stat_vars']['logFile'];
$execCmd = 'echo "'.addslashes($LogLine).'" >> '.$this->config['stat_vars']['logFile'];
exec($execCmd);
$GLOBALS['TT']->pull();
break;
(3-3/3)