[TYPO3-dev] How to use the new autoloader feature?

Oliver Hader oliver at typo3.org
Fri May 29 18:23:38 CEST 2009


Hi Ernesto,

Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker wrote: on 29.05.2009 12:57:
> 
>>> have a look to t3lib/core_autoload.php which is the registry for core
>>> classes. There is a way for extensions as well providing own registry
>>> file in root of extension dir (ext_autoload.php) which will be created
>>> by extdeveval
>> IMHO using a standard filename and class name pattern should be enough
>> for the autoloader to find the class. Only legacy class names that don't
>> match the requirements should be registered manually.
> 
> That was my suggestion too, but it seems that we need to "register" all
> classes in the array, even if they could be found by naming conventions.
>  Might be a bit "faster".

In fact using a predefined registry is faster than extracting parts from
a string and find accordant files. But the main thing is that the
autoloader in general is much faster than calling require_once() on
files that are not used at all... ;-)

> extdeveval seems to have a function to generate the required file.

Exactly. The SVN version on Forge should have this functionality one
day. I just looked it up and the feature is currently still pending:
http://forge.typo3.org/issues/show/3386

olly
-- 
Oliver Hader
TYPO3 Release Manager 4.3




More information about the TYPO3-dev mailing list