[TYPO3-dev] using TCEMAIN clear_cacheCmd in frontend in 4.5 trunk
Jigal van Hemert
jigal at xs4all.nl
Fri Dec 24 11:45:27 CET 2010
Hi,
On 24-12-2010 8:24, Tymoteusz Motylewski wrote:
> W dniu 2010-12-23 17:07, Krystian Szymukowicz pisze:
>> What is the solution for that? Is TCEMAIN only supposed to be used from
>> BE ?
> There is similar issue on the bug tracker. See the notes here by Oliver:
> http://bugs.typo3.org/view.php?id=7042
>
> According to this two sources cache should be cleared like this:
> $tce = t3lib_div::makeInstance('t3lib_TCEmain');
> $tce->stripslashes_values = 0;
> $tce->start(array(), array());
> $tce->clear_cacheCmd('pages');
An extra note:
t3lib_TCEmain needs a BE user to see what is allowed (for clearing
'pages', 'all' or 'temp_CACHED'), but the start() method allows you to
use a alternative user object.
As far as I could determine from the source code you need:
$myBackendUser = t3lib_div::makeInstance('t3lib_userAuth');
$myBackendUser->user['uid'] = 0;
$myBackendUser->user['username'] = 'cacheUser';
$myBackendUser->user['admin'] = TRUE;
$myBackendUser->user['uc']['recursiveDelete'] = FALSE;
And pass it with $tce->start(array(), array(), $myBackendUser);
Haven't tested it.
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-dev
mailing list