[TYPO3-v4] autoloader and path

Steffen Kamper info at sk-typo3.de
Tue Jan 4 15:28:44 CET 2011


Hi,

i see this pattern often in ext_autoload to determine the path:

$extensionPath = t3lib_extMgm::extPath(extkey);

As the autoloader reads this file and expects an array, this file should 
be cheap. Imagine 100 requests to autoloader with makeInstance. This 
would be 100 times calling t3lib_extMgm::extPath. Even this function is 
static and small, this can be prevented by using

$extensionPath = dirname(__FILE__);

(__DIR__ is php >=5.3 only)

I suggest to use this pattern instead which makes it a lot faster.
Your opinion?

vg Steffen


More information about the TYPO3-project-v4 mailing list