[TYPO3-v4] autoloader and path

Dmitry Dulepov dmitry.dulepov at typo3.org
Thu Jan 6 10:59:04 CET 2011


Hi!

Steffen Kamper wrote:
>
> 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.

Isn't the implementation cheap?

public static function extPath($key, $script = '') {
	global $TYPO3_LOADED_EXT;
	if (!isset($TYPO3_LOADED_EXT[$key])) {
		throw new BadFunctionCallException(
			'TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded!',
			1270853878
		);
	}
	return PATH_site.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$script;
}


-- 
Dmitry Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/

Free TYPO3 support is provided only in TYPO3 mailing lists.
More information: http://typo3.org/community/mailing-lists/


More information about the TYPO3-project-v4 mailing list