[TYPO3-core] Feature #9633: Implement autoloading for TYPO3

Bernhard Kraft kraftb at kraftb.at
Sun Apr 26 23:51:38 CEST 2009


Martin Kutschker schrieb:

>> 2) For classical extensions and the TYPO3 core, we use the "registry"
>> concept which is basically an associative array mapping from class names
>> to fully qualified file names.
>> Every "classical" extension wanting to use the autoloader needs to ship
>> a file called ext_autoload.php in its root directory (can be
>> autogenerated with extdeveval). The core ships such a file as well,
>> located in t3lib/core_autoload.php.
>> When the autoloader is started, the core files are automatically added
>> to the registry by loading the t3lib/core_autoload.php file.
>> ext_autoload.php files are loaded on demand when needed.
> 
> No need to do this, the autoloader patch mentioned has a PHP parser
> (Dmitry's original uses a regexp, mine uses PHP's tokenizer) to extract
> the class names (which worked fast and well in my tests).


Hello !

I have not digged very much into the autoloader problem, altough I
totally agree the problem of "chain loading" almost all class files has
to get solved.

For the above cited question I should note, that creating a "registry"
should be something which is done either totally "automagically", or on
a "clear class-cache" request.

In the case of "homebrewn" php parser or php-tokenizer I would opt for
the php-tokenizer. AFAIK it is just a by-product of the php-engine - its
the same code which creates the tokenizers output as which parses the
executed php files ...

It would altogether be a good idea to have a class
class.t3lib_parsephp.php to allow reading a php-file to a structured
array representing the parsed file - this would easily allow to modidfy
and clean-up all php files (like the "copyright 200x" problem, arising
every year ...) Probably this class should go to extdeveval, and not
into the core.



greets,
Bernhard
-- 
Freiheit ist immer Freiheit des Andersdenkenden.
Rosa Luxemburg, 1871-1919
--------------------------------------------------
www.think-open.at


More information about the TYPO3-team-core mailing list