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

Dmitry Dulepov dmitry.dulepov at gmail.com
Fri Oct 24 20:14:28 CEST 2008


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.

> Is there no better way to bootstrap the system? So the initial run can
> be invoked via the installer, which of course must use the good 'ol
> "require".

There is a system registry for this purpose in
t3lib/stddb/autolod_*.ser. I though about installer too but I did
not do it because (1) it will enlarge the patch even more and (2)
not everyone uses 1-2-3 installer. We probably should add it to
update wizard.

> You'll probably have thought over the problem, but I'm not happy with
> the fact that now the code runs only with a pre-compiled data set. This
> would mean I cannot simply check-out from SVN. Anyone who checks in a
> new class will have to check-in a new autoloader file as well. This
> looks error prone.

You can update autoloader from Tools>DB. If you add a new class,
just go to Tools>DB and update it. In SVN version you can also
update system registry.

> 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(). 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.

> 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.

-- 
Dmitry Dulepov
TYPO3 translations support
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog:
http://typo3bloke.net/post-details/get_typo3_coding_guidelines_here/


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