[Typo3-dev] User extension of class.t3lib_div.php
Christian Jul Jensen
christian at julletology.dk
Tue Sep 2 14:23:11 CEST 2003
Hi
On Tue, 02 Sep 2003 14:14:25 +0200, Ingmar Schlecht
<ingmars at REMOVETHISweb.de> wrote:
> Christian Jul Jensen wrote:
> > The problem with this is that t3lib_div also provides the
> > makeInstance function that checks for user extensions of classes, in
> > other words the class is instantiated without checking for any user
> > extension.
>
> No, t3lib_div is AFAIK never instantiated. Tthe functions are always
> called directly like this: "t3lib_div::doSomthing();", so no extension
> class would be used anyway.
Ahhh, that makes sense.
> ...which makes this suggestion obsolete:
> > Maybe makeInstance should be moved to a class for itself in future
> > releases, in order to avoid this problem.
You're right. Still these functions should be extend-/changeable, so
maybe making a global object $DIV, instantiated by
t3lib_div::makeInstance('t3lib_div'); would be a solution. That way you
could actually modify even the makeInstance function.
> "Solution" would be to hardcode it into the t3lib_div PHP-file or
> otherwise provide a completely independant class and call it like
> tx_yourext_div::doSomething().
The problem is that the function is called from other scripts, which I
have no intention of changing. In particular I'm trying to solve the
problem for the da_newsletter extension, and I could fix at a higher
level, just figured it would be cleaner to do it in the div-script,
since the other encoding is done here.
Thanks a lot Ingmar, you saved me a lot of time there.
--
Christian Jul Jensen
Freelance webprogrammer
TYPO3 typehead Denmark
More information about the TYPO3-dev
mailing list