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

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Oct 9 13:57:59 CEST 2008


Robert Lemke wrote: on 08.10.2008 14:03:

> Hmm, magic .... how about this one (demo code, not tested):
> 
> interface t3lib_singleton {
> }
> 
> class tx_myextension_myclass implements t3lib_singleton {
> }
> 
> class t3lib_div {
> 
>     static $instances = array();
> 
>     public static function makeInstance($className, ...) {
>         if (isset(self::$instances[$className])) return
> self::$instances[$className];
>         $instance = new $className();
>         if ($instance instanceof t3lib_singleton)
> self::$instances[$className] = $instance;
>         return $instance;
>     }
> }
> 
> How about that?

Same thought I have, should have read the whole thread before. That's
what I would do also!

Steffen already "thx"ed, so I expect a patch coming from him soon. ;)

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list