Index: t3lib/class.t3lib_extmgm.php =================================================================== --- t3lib/class.t3lib_extmgm.php (revision 7724) +++ t3lib/class.t3lib_extmgm.php (working copy) @@ -122,6 +122,30 @@ ***************************************/ /** + * Checks whether the extension with extension key $key is installed. + * + * @param string $key key of the extension to test, must not be empty + * @param boolean $exceptionIfNotLoaded + * whether an exception should be thrown if the extension is not + * loaded + * + * @return boolean TRUE if the extension is loaded, FALSE otherwise + */ + public static function isInstalled($key, $exceptionIfNotLoaded = FALSE) { + $isInstalled = t3lib_div::inList( + $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'], $key + ); + if (!$isInstalled && $exceptionIfNotLoaded) { + throw new BadFunctionCallException( + 'TYPO3 Fatal Error: Extension "' . $key . '" was not installed!', + 1272625953 + ); + } + + return $isInstalled; + } + + /** * Returns true if the extension with extension key $key is loaded. * Usage: 109 *