[TYPO3-dev] Data exchange between USER/USER_INT

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Dec 3 20:53:37 CET 2007


Oliver Hader wrote: on 03.12.2007 13:19:

> I have a TypoScript situation like this:
> 
> 10 = COA
> 10 {
>   10 = USER_INT
>   10.userFunc = tx_myext_pi1->main
>   20 = USER
>   20.userFunc = tx_myext_pi2->main
> }
> 
> The USER part (pi2) is rendering something and generates also some
> information that is required by pi1, the USER_INT object. If the page
> was cached once, the USER object isn't processed anymore and thus the
> USER_INT doesn't have the required additional information.
> 
> Currently the USER object is putting it's information to the TSFE:
> $GLOBALS['TSFE']->config['extensionStorage']['tx_myext']['whatever'] = 1
> 
> The $TSFE->config array is cached in the table 'cache_pages' by default
> and thus, the USER_INT object has the required information automatically
> on the next hit to that page.
> 
> But my question to you is: What would you use in this case? What is your
> best-practise?

That would be a new way I have never thought about. :) But to me using
the "config" array seems a bit of a "misuse" for this purpose.

I would let USER store the information in cache_hash (see other post
about the API). The problem here is the same as in your approach, the
cached information will only be "refreshed" once the USER object is
recreated. But if this is desired (e.g. not dependent on user session or
page where the plugin is being called from), you could use any cache you
like.


Cheers,
Ernesto




More information about the TYPO3-dev mailing list