[TYPO3-dev] using TCEMAIN clear_cacheCmd in frontend in 4.5 trunk

Steffen Kamper info at sk-typo3.de
Fri Dec 24 11:56:51 CET 2010


Hi,

Am 24.12.2010 11:45, schrieb Jigal van Hemert:
> 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.
>

that's possible, but an ugly workaround to clear cache imho. I'll try to 
make a clean wrapper these days.

vg Steffen




More information about the TYPO3-dev mailing list