[TYPO3-project-4-3] FYI: patch for autoloader is in the BT

Martin Kutschker masi-no at spam-typo3.org
Sat Oct 25 19:48:31 CEST 2008


Dmitry Dulepov schrieb:
> Hi!
> 
> Martin Kutschker wrote:
>> Wow, much more then I envisaged. I had only implemented a slim
>> classname-to-filename-mapping, but you made the registry Ingo wanted.
> 
> If I am not very much mistaken, registry was my idea... ;) May be he
> wanted it, I am not sure.

Oh, I'm sorry. I only recall now that Ingo originally opposed the idea
of autoloading completely. After he changed sides I remember now talking
to him about the details.

>> I have a question concerning the t3lib_autoload class. It implement the
>> t3lib_Singleton interface but has a getInstance method. This is not the
>> way it should be. The interface is a signal for t3lib_div::makeInstance
>> to hold a reference of the class instance. Please either remove the
>> interface or the method. Otherwise anyone who browses through the code
>> gets the wrong ideas about t3lib_Singleton.
> 
> Method is there to skip creating global variable. Check the comment
> for the getInstance().

t3lib_div::makeInstance uses a private static variable. Maybe you didn't
read the thread where we talked about singletons, but it turned out that
it is better (for the unit tests we may see some day) to use a storage
outside of the class itself (in our case t3lib_div::makeInstance).

> I thought a lot about it and it seemed as
> overhead for me too. But finally I decided to leave it as it is now.

Sorry, but this would break the idea of t3lib_div::makeInstance and it's
implementation details, so it has to be changed. Don't worry, I will
change it for you.

>> As a whole this looks very promising. Sorry for nitpicking. I hope I
>> didn't annoy you too much with my comments.
> 
> Not at all. Every question is absolutely valid and all concerns are
> fair. I share some of them. But I am sure we can improve autoload
> feature while we actually use it.

I agree. There is still time even for the first alpha.

Masi


More information about the TYPO3-project-4-3 mailing list