[TYPO3-ect] Autoload-function for lib/div?

Steffen Kamper steffen at sk-typo3.de
Tue Aug 14 13:00:37 CEST 2007


Hi,

i don't see that point either, because e.g.tx_lib is included and doesn't 
need this line in TS.
If you reference in php, you make your normal include_once.

vg  Steffen

"Joerg Schoppet" <joerg at schoppet.de> schrieb im Newsbeitrag 
news:mailman.1.1187086421.13109.typo3-team-extension-coordination at lists.netfielders.de...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Elmar Hinz wrote:
>>> if (t3lib_div::int_from_ver(phpversion())>=5000000) {
>>> eval('spl_autoload_register(array(\'tx_myext_Main\', \'loadClass\'));');
>>> }
>>
>> Hi Jörg,
>>
>> how does this register work? I expect, that you can't put it into the 
>> class
>> file because the job is to load the class file.
>>
>> Regards
>>
>> Elmar
>>
>>
> Hi,
>
> The idea behind  this is the following:
>
> In your TypoScript-Template of your Website, one of the first statements
> will be "includeLibs.tx_lib = EXT:lib/class.tx_lib.php"
>
> in the file class.tx_lib.php is the class-definition
>
> final class tx_lib {
> private __construct() {
> }
> static function loadClass($className) {
> }
> }
>
>
> AND after the class-definition is the if-statement to register the
> function for autoload-capability.
>
>
> Joerg
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGwYBbq5Me6rRDqPURAmWPAJ98t5x/nE4JbdigWYqP+3JrD0VGmwCfbs/4
> zUuI6XlU0XRpjfWLLwCpJBY=
> =J/Ni
> -----END PGP SIGNATURE----- 




More information about the TYPO3-team-extension-coordination mailing list