[Typo3-dev] User extension of class.t3lib_div.php

Martin Kutschker Martin.T.Kutschker at blackbox.net
Wed Sep 3 08:58:36 CEST 2003


Date: Wed, 03 Sep 2003 02:56:35 +0200
From: Kasper Skârhoj <kasper at typo3.com>
To: typo3-dev at lists.netfielders.de

> It would be quite easy to make a search/replace on t3lib_div:: to
> $GLOBALS['DIV']->
>
> (and for other classes as well) but what is the performance loss ? ( if
> any) - and it is also uglier.
>
> But it would be backwards compatible!

Wouldn't you have to change all the functions in class.t3lib_div.php

> We can discuss later this month.

Sure, but just an idea before I forget it. The archive may serve as my memory :-)

How about changing the static classes into singletons? Unlike the straightforward instance in $DIV we don't introduce a number of globals. The 'real' objects would be static members of the factory.

So you'd have a $div = t3lib_div::getInstance() at the top of the code, followed by $div->some_func() etc. But of, course this is also not backwards compatible.

A more backward compatible idea is to make class.t3lib_div.php a kind of wrapper which includes its fucntions. At the the beginning of the file some code would decide whether to include the default code or some extension code.

A note on all this schemes:

An extension might only change one function. And more than one extension may provide new functions.

None of the solutions so far addreess these problems.

Regards,
Masi






More information about the TYPO3-dev mailing list