[TYPO3-project-4-3] Status of autoloader
Oliver Hader
oliver at typo3.org
Wed Jun 10 13:37:32 CEST 2009
Hi Steffen,
Steffen Kamper schrieb:
> Hi,
>
> i'm not really pleasured with the status of autoloader we have now in
> trunk.
> I followed development, and the first version coded by Dmitry and Masi
> had some parts that worked well and was removed by later versions.
>
> So i miss the following parts:
>
> * find class by resolving naming convention (this was in first version)
Since we don't have a real naming convention and had an enourmous
discussion about just introducing that is similar to the FLOW3
convention, it might be difficult to write rules for that.
Using a registry file is faster than extracting parts of a file name and
checking each one whether it exists in the file system.
> * scan extensions and add classes to registry automatically
The problems are in updating a local registry file that has to happen
every time an extension is installed/uninstalled. If you're about to
develop a new extension you'll have to trigger the regeneration of all
files manually. Now you just add a new line to the ext_autoload.php.
Besides that there would be an autogenerated registry file that also
contains extensions/modules that do not use autoloading at all.
> * find XCLASS, removal of the last lines in class files doing the
> require_once. XCLASS is defined in GLOBALS array, so finding them by
> traversing the GLOBALS shouldn't be such hard task. Add the XCLASS in
> registry (you could use a chain syntax: classA => ux_classA =>
> ux_ux_classA)
This might change behaviour since until now XCLASSes are always included
at the end of a file.
> The situation now is incomplete and unflexible. Don't misunderstand me,
> we saved a lot of time now by removing a lot of require_once statements,
> but for me the autoloader is still unfinished.
Why? It's up to the developer to decide whether to use autoloading...
olly
--
Oliver Hader
TYPO3 Release Manager 4.3
More information about the TYPO3-project-4-3
mailing list