[TYPO3-core] RFC: #14258: t3lib_extMgm should provide API to determinde whether ext is installed or not
Oliver Klee
typo3-german-02 at oliverklee.de
Fri Apr 30 20:07:01 CEST 2010
Hi,
> + * @param boolean If $exitOnError is true and the extension is not loaded the function will die with an error message
> + * @return boolean
> + */
> + public static function isInstalled($key, $exitOnError=0) {
> + $isInstalled = t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'], $key);
> + if ($exitOnError && !isset($isInstalled)) {
> + throw new BadFunctionCallException(
> + 'TYPO3 Fatal Error: Extension "' . $key . '" was not installed!',
> + 1272625953
> + );
> + }
> + return $isInstalled;
What's the usecase for $extOnError? I'd suggest to just remove this
parameter and let any caller take care of throwing an exception if needed.
Oli
--
Certified TYPO3 Integrator | TYPO3 Security Team Member
More information about the TYPO3-team-core
mailing list