[TYPO3-project-4-3] Splitting t3lib_div and having autoloader instead of inclusions

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Sep 18 11:25:14 CEST 2008


Martin Kutschker wrote: on 18.09.2008 10:35:

>> In my eyes we don't need to have a "huge" file->class array or database
>> cache with information on all classes. We just need that information for
>> exotic classnames which cannot be found by means of naming conventions.
>> So if one sticks to our naming conventions, we won't store that in the
>> search-cache:
>>
>> - t3lib_TCEmain => t3lib/class.t3lib_tcemain.php
>> - tslib_feTCE => tslib/class.tslib_fetce.php
>> - tx_lowlevel_cleaner_core =>
>> EXT:lowlevel/class.tx_lowlevel_cleaner_core.php
>> - tx_sv_authbase => EXT:sv/class.tx_sv_authbase.php
> 
> Agreed (see other my other posts).

>> But we will need to store the information (in 4) and use it (in 2) for
>> stuff like:
>>
>> - tslib_cObj => tslib/class.tslib_content.php
>> - FE_loadDBGroup => tslib/class.tslib_pagegen.php
>> - myclass => EXT:myext/file.php
>>
>> etc. This will keep the cache "small" (by sticking to our naming
>> conventions).
> 
> And we can even get rid of those if we split up those old files. Make a
> new file sticking to the naming scheme. The old file will the contain
> only a require for each of the classes it contained in earlier versions
> of TYPO3. So those who use the old require and the new autoloader will
> be happy.

Sound reasonable! So if an extension wants to use "auto-loading", it 
just has to stick to the naming convention. If not, it uses the "good 
old" require_once(...) call.

There are some other things that has to be cleaned up on that occasion, 
e.g. the classes in typo3/classes/ which seem to have been introduced 
for the new backend, but are somehow "lost" in that subdirectory. I 
would rather call that subdir "backend/" and the files 
class.backend_modulemenu.php and the classes "backend_modulemenu" etc.

Also the *.inc files in typo3/. This is a bit difficult, because also 
here the class names would have to be changed (incompatible change in 
regard to XCLASSes). E.g.

typo3/class.file_list.inc contains class fileList.

Correct would be:

typo3/class.filelist.php containing class typo3_filelist or something. 
Or make the typo3/ classes an exception, but then either no auto-loading 
or make that extensions known to the auto-loader.

Cheers,
Ernesto


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