Feature #20849 » bug_11669_no_cache_reason.diff
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie) | ||
---|---|---|
*
|
||
* @return void
|
||
*/
|
||
function set_no_cache() {
|
||
if (function_exists('debug_backtrace')) {
|
||
$trace = debug_backtrace();
|
||
// This is a hack to work around ___FILE___ resolving symbolic links
|
||
$PATH_site_real = str_replace('t3lib','',realpath(PATH_site.'t3lib'));
|
||
$file = $trace[0]['file'];
|
||
if (substr($file,0,strlen($PATH_site_real))===$PATH_site_real) {
|
||
$file = str_replace($PATH_site_real,'',$file);
|
||
function set_no_cache($reason = '') {
|
||
if (strlen($reason)) {
|
||
$warning = '$TSFE->set_no_cache() was triggered. Reason: ' . $reason . '.';
|
||
} else {
|
||
if (function_exists('debug_backtrace')) {
|
||
$trace = debug_backtrace();
|
||
// This is a hack to work around ___FILE___ resolving symbolic links
|
||
$PATH_site_real = str_replace('t3lib','',realpath(PATH_site.'t3lib'));
|
||
$file = $trace[0]['file'];
|
||
if (substr($file,0,strlen($PATH_site_real))===$PATH_site_real) {
|
||
$file = str_replace($PATH_site_real,'',$file);
|
||
} else {
|
||
$file = str_replace(PATH_site,'',$file);
|
||
}
|
||
$line = $trace[0]['line'];
|
||
$trigger = $file.' on line '.$line;
|
||
} else {
|
||
$file = str_replace(PATH_site,'',$file);
|
||
$trigger = '[unknown]';
|
||
}
|
||
$line = $trace[0]['line'];
|
||
$trigger = $file.' on line '.$line;
|
||
} else {
|
||
$trigger = '[unknown]';
|
||
$warning = '$TSFE->set_no_cache() was triggered by '.$trigger.'.';
|
||
}
|
||
$warning = '$TSFE->set_no_cache() was triggered by '.$trigger.'. ';
|
||
if ($this->TYPO3_CONF_VARS['FE']['disableNoCacheParameter']) {
|
||
$warning.= 'However $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';
|
||
$warning.= ' However, $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';
|
||
$GLOBALS['TT']->setTSlogMessage($warning,2);
|
||
} else {
|
||
$warning.= 'Caching is disabled!';
|
||
$warning.= ' Caching is disabled!';
|
||
$this->no_cache = 1;
|
||
}
|
||
t3lib_div::sysLog($warning, 'cms', 2);
|