Hallo Roger,
ich habe wie von adventuremaker schon abgesprochen die Anpassungen in eine Extension gepackt. Diese möchte ich nach Fertigstellung natürlich auch veröffentlichen. Soweit funktioniert eigentlich auch alles ganz gut. Nur werden bei mir jetzt aus irgendwelchen gründen die Startseite nicht mehr in das Log geschrieben.
Jemand ne idee warum?
Hier der Quellcode der Extension bei dem in der Zeile 124 die hier bereits besprochene Erweiterung entählt. Den rest habe ich noch nicht bearbeitet.
<?php
class ux_tslib_fe extends tslib_fe {
/**
* Checks if config-array exists already but if not, gets it
* Addition by Nico Thomaier @line 123: add realurl generated pagename to array
* @return void
*/
function getConfigArray() {
$setStatPageName = false;
if (!is_array($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) { // If config is not set by the cache (which would be a major mistake somewhere) OR if INTincScripts-include-scripts have been registered, then we must parse the template in order to get it
$GLOBALS['TT']->push('Parse template','');
// Force parsing, if set?:
$this->tmpl->forceTemplateParsing = $this->forceTemplateParsing;
// Start parsing the TS template. Might return cached version.
$this->tmpl->start($this->rootLine);
$GLOBALS['TT']->pull();
if ($this->tmpl->loaded) {
$GLOBALS['TT']->push('Setting the config-array','');
// t3lib_div::print_array($this->tmpl->setup);
$this->sPre = $this->tmpl->setup['types.'][$this->type]; // toplevel - objArrayName
$this->pSetup = $this->tmpl->setup[$this->sPre.'.'];
if (!is_array($this->pSetup)) {
$this->printError('The page is not configured! [type= '.$this->type.']['.$this->sPre.']');
exit;
} else {
$this->config['config']=Array();
// Filling the config-array.
if (is_array($this->tmpl->setup['config.'])) {
$this->config['config'] = $this->tmpl->setup['config.'];
}
if (is_array($this->pSetup['config.'])) {
reset($this->pSetup['config.']);
while(list($theK,$theV)=each($this->pSetup['config.'])) {
$this->config['config'][$theK] = $theV;
}
}
// if .simulateStaticDocuments was not present, the default value will rule.
if (!isset($this->config['config']['simulateStaticDocuments'])) {
$this->config['config']['simulateStaticDocuments'] = trim($this->TYPO3_CONF_VARS['FE']['simulateStaticDocuments']);
}
if ($this->config['config']['simulateStaticDocuments']) {
// Set replacement char only if it is needed
$this->setSimulReplacementChar();
}
// Set default values for removeDefaultJS and inlineStyle2TempFile so CSS and JS are externalized if compatversion is higher than 4.0
if (!isset($this->config['config']['removeDefaultJS']) && t3lib_div::compat_version('4.0')) {
$this->config['config']['removeDefaultJS'] = 'external';
}
if (!isset($this->config['config']['inlineStyle2TempFile']) && t3lib_div::compat_version('4.0')) {
$this->config['config']['inlineStyle2TempFile'] = 1;
}
// Processing for the config_array:
$this->config['rootLine'] = $this->tmpl->rootLine;
$this->config['mainScript'] = trim($this->config['config']['mainScript']) ? trim($this->config['config']['mainScript']) : 'index.php';
// STAT:
$theLogFile = $this->TYPO3_CONF_VARS['FE']['logfile_dir'].strftime($this->config['config']['stat_apache_logfile']);
// Add PATH_site left to $theLogFile if the path is not absolute yet
if (!t3lib_div::isAbsPath($theLogFile)) $theLogFile = PATH_site.$theLogFile;
if ($this->config['config']['stat_apache'] && $this->config['config']['stat_apache_logfile'] && !strstr($this->config['config']['stat_apache_logfile'],'/')) {
if (t3lib_div::isAllowedAbsPath($theLogFile)) {
if (!@is_file($theLogFile)) {
touch($theLogFile); // Try to create the logfile
t3lib_div::fixPermissions($theLogFile);
}
if (@is_file($theLogFile) && @is_writable($theLogFile)) {
$this->config['stat_vars']['logFile'] = $theLogFile;
$setStatPageName = true; // Set page name later on
} else {
$GLOBALS['TT']->setTSlogMessage('Could not set logfile path. Check filepath and permissions.',3);
}
}
}
$this->config['FEData'] = $this->tmpl->setup['FEData'];
$this->config['FEData.'] = $this->tmpl->setup['FEData.'];
}
$GLOBALS['TT']->pull();
} else {
$this->printError('No template found!');
exit;
}
}
// Initialize charset settings etc.
$this->initLLvars();
// We want nice names, so we need to handle the charset
if ($setStatPageName) {
// Make life easier and accept variants for utf-8
if (preg_match('/utf-?8/i', $this->config['config']['stat_apache_niceTitle'])) {
$this->config['config']['stat_apache_niceTitle'] = 'utf-8';
}
if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
$shortTitle = $this->csConvObj->utf8_encode($this->page['title'],$this->renderCharset);
} elseif ($this->config['config']['stat_apache_niceTitle']) {
$shortTitle = $this->csConvObj->specCharsToASCII($this->renderCharset,$this->page['title']);
} else {
$shortTitle = $this->page['title'];
}
$len = t3lib_div::intInRange($this->config['config']['stat_apache_pageLen'],1,100,30);
if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
$shortTitle = rawurlencode($this->csConvObj->substr('utf-8',$shortTitle,0,$len));
} else {
$shortTitle = substr(preg_replace('/[^.[:alnum:]_-]/','_',$shortTitle),0,$len);
}
$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->type,$pageName);
// REALURL EXTENSION - Start
$pageName = str_replace('[realurl]',$_SERVER['REDIRECT_URL'],$pageName);
// REALURL EXTENSION - END
$temp = $this->config['rootLine'];
array_pop($temp);
if ($this->config['config']['stat_apache_noRoot']) {
array_shift($temp);
}
$len = t3lib_div::intInRange($this->config['config']['stat_titleLen'],1,100,20);
if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
$path = '';
$c = count($temp);
for ($i=0; $i<$c; $i++) {
if ($temp[$i]['uid']) {
$p = $this->csConvObj->crop('utf-8',$this->csConvObj->utf8_encode($temp[$i]['title'],$this->renderCharset),$len,"\xE2\x80\xA6"); // U+2026; HORIZONTAL ELLIPSIS
$path .= '/' . rawurlencode($p);
}
}
} elseif ($this->config['config']['stat_apache_niceTitle']) {
$path = $this->csConvObj->specCharsToASCII($this->renderCharset,$this->sys_page->getPathFromRootline($temp,$len));
} else {
$path = $this->sys_page->getPathFromRootline($temp,$len);
}
if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
$this->config['stat_vars']['pageName'] = str_replace('[path]', $path.'/', $pageName);
} else {
$this->config['stat_vars']['pageName'] = str_replace('[path]', preg_replace('/[^.[:alnum:]\/_-]/','_',$path.'/'), $pageName);
}
}
// No cache
if ($this->config['config']['no_cache']) { $this->set_no_cache(); } // Set $this->no_cache true if the config.no_cache value is set!
// Check PATH_INFO url
if ($this->absRefPrefix_force && strcmp($this->config['config']['simulateStaticDocuments'],'PATH_INFO')) {
$redirectUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR').'index.php?id='.$this->id.'&type='.$this->type;
if ($this->config['config']['simulateStaticDocuments_dontRedirectPathInfoError']) {
$this->printError('PATH_INFO was not configured for this website, and the URL tries to find the page by PATH_INFO!<br /><br /><a href="'.htmlspecialchars($redirectUrl).'">Click here to get to the right page.</a>','Error: PATH_INFO not configured');
} else {
header('Location: '.t3lib_div::locationHeaderUrl($redirectUrl));
}
exit;
// $this->set_no_cache(); // Set no_cache if PATH_INFO is NOT used as simulateStaticDoc. and if absRefPrefix_force shows that such an URL has been passed along.
}
}
}
?>
Wäre super wenn jemand ne idee hätte. Hab mir den Code schon genau angesehen bin aber bis jetzt noch nicht auf den BUG gestoßen
Gruß Semidark