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

Martin Kutschker masi-no at spam-typo3.org
Fri Oct 24 18:17:34 CEST 2008


Dmitry Dulepov schrieb:
> Hi!
> 
> Patch for the TYPO3 autoloader is in the BT. Here is the link:
> http://bugs.typo3.org/view.php?id=9633
> I tested the patch for two days, so far runs good. Interested
> parties can try it ;)
> 
> Here is a copy of the text from the BT entry:
> ====================
> The attached patch implements autoloading for TYPO3 classes.

Wow, much more then I envisaged. I had only implemented a slim
classname-to-filename-mapping, but you made the registry Ingo wanted.

> Class registry consists from two groups, each group contains two files.
> 
> The first group is located at t3lib/stddb/autoload_*.ser and
> includes information about all classes from t3lib/ and typo3/
> directories. This group is used when TYPO3 is just installed.
>
> The second group consists from files with the same name in
> typo3conf/ directory. These files are unique for the installation
> and list classes for core + installed extensions. Extension Manager
> updates these files when extension is installed or uninstalled. This
> group reduced memory usage at runtime.

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

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.

As you have provided sysext/lowlevel/dbint/cli/autoloader_cli.php	you
have given found a solution.

> When user just installs TYPO3, he can login to the system. The big
> yellow box will prompt him to update autoloader database and provide
> a link to Tools>DB module. Additionally command line script exists
> to update autoloader data if something goes wrong in Backend.

So you have something like I said only in a different place.

Hm, I still feel that the rebuilding of the auto-loader belongs to the
installer. After an upgrade this is the first UI you must invoke anyway.

But this is not a show stopper.

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.

AFAIR using t3lib_Singleton plus t3lib_div::makeInstance is more unit
test friendly (which was the point of the new singleton scheme), so I
would prefer it if it could be used that way, even if that meas you must
for once include t3lib_div the old way.

As a whole this looks very promising. Sorry for nitpicking. I hope I
didn't annoy you too much with my comments.

Masi


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