[TYPO3-ect] Autoload-function for lib/div?
Joerg Schoppet
joerg at schoppet.de
Tue Aug 14 12:13:47 CEST 2007
-----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