[TYPO3-core] RFC #9505: Make the caches in TYPO3 use the new caching framework

Ingo Renner ingo at typo3.org
Tue Oct 7 22:28:47 CEST 2008


Martin Kutschker wrote:

Hi Masi,

> I stumbled across this line "TODO check where $expTime is used, the new 
> caching API can't handle it, so it can be removed". Does this mean that 
> cached contents may never expire? How is the cache expiry to be handled?

It's like the TODO says: I didn't check yet where that variable comes 
from. Do you have any hints?
However, with the new framework expiration is set when the cache entry 
is inserted into the cache.


> Two new global variables are added: $cacheManager and $TYPO3_CACHE. What 
> is the reasoning behind the different naming schemes? 

I can't remember exactly why $TYPO3_CACHE is uppercase, but as it is 
only used in a few places it would be an easy task to change it to 
$typo3Cache or more specifically $typo3CacheFactory (that's what it 
really is).

> Even if 
> $cacheManager may be used in theory in a wider context, it's a TYPO3 
> variable. 

Do you mean it should be renamed $typo3CacheManager ?

> I know that the 5.0 team doesn't like singletons but I would 
> appreciate if we could avoid new globals if possible. Actually I have no 
> idea if there must be only one copy of the cache manager around, so 
> maybe I'm on a wrong track here.

at least only one is needed, so I'd be fine with a singleton, too. But 
to achieve this t3lib_div::makeInstance() must be made aware of singletons.
How about a simple check whether the class has a method named 
getInstance(), if that is the case it is used instead of the new operator?


Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list