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

Dmitry Dulepov dmitry.dulepov at typo3.org
Tue Jan 11 12:37:36 CET 2011


Hi!

Krystian Szymukowicz wrote:
> in rev. 8481 there has been added writelog when clearing the cache.
>
> public function clear_cacheCmd($cacheCmd) {
>
> $this->BE_USER->writelog(..........
>
>
>
> But some extesions like Dmitry Dulepov 'comments' are using
> 'clear_cacheCmd' from frontend where $this->BE_USER is not initialised.
>
> So we get:
> Fatal error: Call to a member function writelog() on a non-object in
> T:\workspace-typo3\typo3\typo3_src-svn-trunk\t3lib\class.t3lib_tcemain.php
> on line 6761
>
>
> What is the solution for that? Is TCEMAIN only supposed to be used from
> BE ?

Theoretically yes but since there is proper way to do that in FE, I would 
prefer if TCEmain code is adjusted to check if BE user is available.

> Is a condition like
>
> if(TYPO3_MODE == 'BE') {
> $this->BE_USER->writelog(....
> }
>
> enough here and can be put into core?

This is a good way in my opinion.

-- 
Dmitry Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/

Free TYPO3 support is provided only in TYPO3 mailing lists.
More information: http://typo3.org/community/mailing-lists/




More information about the TYPO3-dev mailing list