[TYPO3-core] RFC: Fix #7657: Add hook to $TSFE->contentStrReplace()

Oliver Hader oh at inpublica.de
Mon Feb 25 15:21:36 CET 2008


Hi Michael,

Michael Stucki schrieb:
> This is a SVN patch request.
> 
> Problem:
> This method allows to overwrite markers in a fully generated website after
> all the caching was already done. So this is very useful for small
> on-the-fly replacements, for example display the fe_user name, or the time
> used for page generation.
> 
> Solution:
> Add a hook which will allow extensions to use this very useful feature.
> 
> Comments:
> $TSFE->contentStrReplace() cannot be used if cacheHeaders are enabled.
> However, this was already the case before this patch.
> 
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=7657
> 
> Branches: TYPO3_4-2

This patch is very useful, thanks!
Just two nits ;-)
* Please use 
isset($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace']) 
before the is_array() check of the same variable, or put it to a 
reference and make the term a bit shorter, e.g.
   $contentStrReplaceHooks =& 
$this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'];
   if (is_array($contentStrReplaceHooks)) {
     ...
     foreach ($contentStrReplaceHooks as ...) { ... }
     ...
   }
* Is the key 'pObj' in the parameters array required 
(t3lib_div::callUserFunction() has '$this' too)?

+1 on reading

olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-team-core mailing list