Index: tests/t3lib/t3lib_extmgmTest.php =================================================================== --- tests/t3lib/t3lib_extmgmTest.php (Revision 10349) +++ tests/t3lib/t3lib_extmgmTest.php (Arbeitskopie) @@ -41,6 +41,7 @@ public function setUp() { $this->globals = array( + 'TYPO3_CONF_VARS' => serialize($GLOBALS['TYPO3_CONF_VARS']), 'TYPO3_LOADED_EXT' => serialize($GLOBALS['TYPO3_LOADED_EXT']), 'TCA' => serialize($GLOBALS['TCA']), ); @@ -472,5 +473,30 @@ t3lib_extMgm::getExtensionVersion($extensionKey) ); } + + /** + * @test + */ + public function getEnabledExtensionListConsidersRequiredExtensions() { + $testrequiRedExtension = uniqid('test'); + $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] = $testrequiRedExtension; + + $extensions = explode(',', t3lib_extMgm::getEnabledExtensionList()); + $this->assertTrue(in_array($testrequiRedExtension, $extensions)); + } + + /** + * @test + */ + public function getEnabledExtensionListConsidersRequiredAndIgnoredExtensions() { + $testRequiredExtension = uniqid('test'); + $testIgnoredExtension = uniqid('test'); + $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] = $testRequiredExtension . ',' . $testIgnoredExtension; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['ignoredExt'] = $testIgnoredExtension; + + $extensions = explode(',', t3lib_extMgm::getEnabledExtensionList()); + $this->assertTrue(in_array($testRequiredExtension, $extensions)); + $this->assertFalse(in_array($testIgnoredExtension, $extensions)); + } } ?> \ No newline at end of file Index: t3lib/config_default.php =================================================================== --- t3lib/config_default.php (Revision 10349) +++ t3lib/config_default.php (Arbeitskopie) @@ -22,6 +22,9 @@ //Security related constant: Comma separated list of file extensions that should be registered as php script file extensions define('PHP_EXTENSIONS_DEFAULT', 'php,php3,php4,php5,php6,phpsh,inc,phtml'); +// Defines a list that are basically required by a TYPO3 system. +define('REQUIRED_EXTENSIONS', 'cms,lang,sv,em,recordlist'); + $TYPO3_CONF_VARS = array( 'GFX' => array( // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and GD library respectively. 'image_processing' => TRUE, // Boolean: Enables image processing features. Disabling this means NO image processing with either GD or IM! @@ -171,7 +174,8 @@ 'em_wsdlURL' => 'http://typo3.org/wsdl/tx_ter_wsdl.php', // The SOAP URL for uploading extensions to the TER2. Usually doesn't need to be changed. 'em_mirrorListURL' => 'http://repositories.typo3.org/mirrors.xml.gz', // Allows to preset the URL for fetching the extension repository mirror list from. Used in the Extension Manager. - 'requiredExt' => 'cms,lang,sv,em,recordlist', // String (exclude). List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager! + 'requiredExt' => '', // String. List of additional extensions which are REQUIRED and cannot be unloaded by the Extension Manager! + 'ignoredExt' => '', // String. List of extensions to be ignored (not loaded), e.g. "em" can be disabled this way. 'excludeForPackaging' => '(CVS|\..*|.*~|.*\.bak)', // String: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax! 'extCache' => 1, //

Integer (0, 1, 2, 3)

0
ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time
1
scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators)
2
scripts cached and prefix includes a hash based on the 'extList' string
3
scripts cached to typo3conf/temp_CACHED_* (no hash included at all...)
'extList' => 'filelist,version,tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler', // String (exclude) List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this! Index: t3lib/class.t3lib_extmgm.php =================================================================== --- t3lib/class.t3lib_extmgm.php (Revision 10349) +++ t3lib/class.t3lib_extmgm.php (Arbeitskopie) @@ -1589,10 +1589,46 @@ $extLoadInContext = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']; } - $extensionList = $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] . ',' . $extLoadInContext; + $extensionList = self::getRequiredExtensionList() . ',' . $extLoadInContext; + $ignoredExtensionList = self::getIgnoredExtensionList(); + // Remove the extensions to be ignored: + if ($ignoredExtensionList && (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript) === FALSE) { + $extensions = array_diff( + explode(',', $extensionList), + explode(',', $ignoredExtensionList) + ); + $extensionList = implode(',', $extensions); + } + return $extensionList; } + + /** + * Gets the list of required extensions. + * + * @return string + */ + public static function getRequiredExtensionList() { + $requiredExtensionList = t3lib_div::uniqueList( + REQUIRED_EXTENSIONS . ',' . $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] + ); + + return $requiredExtensionList; + } + + /** + * Gets the list of extensions to be ignored (not to be loaded). + * + * @return string + */ + public static function getIgnoredExtensionList() { + $ignoredExtensionList = t3lib_div::uniqueList( + $GLOBALS['TYPO3_CONF_VARS']['EXT']['ignoredExt'] + ); + + return $ignoredExtensionList; + } } ?> Index: typo3/sysext/em/classes/index.php =================================================================== --- typo3/sysext/em/classes/index.php (Revision 10349) +++ typo3/sysext/em/classes/index.php (Arbeitskopie) @@ -266,7 +266,7 @@ // Setting internal static: - $this->requiredExt = t3lib_div::trimExplode(',', $TYPO3_CONF_VARS['EXT']['requiredExt'], 1); + $this->requiredExt = t3lib_div::trimExplode(',', t3lib_extMgm::getRequiredExtensionList(), TRUE); // Initialize Document Template object: $this->doc = t3lib_div::makeInstance('template'); Index: typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php =================================================================== --- typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php (Revision 10349) +++ typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php (Arbeitskopie) @@ -245,7 +245,7 @@ $list[$key]['categoryShort'] = $list[$key]['category']; $list[$key]['category'] = isset($this->categories[$list[$key]['category']]) ? $this->categories[$list[$key]['category']] : $list[$key]['category']; - $list[$key]['required'] = t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'], $extKey); + $list[$key]['required'] = t3lib_div::inList(t3lib_extMgm::getRequiredExtensionList(), $extKey); $constraints = $this->humanizeConstraints($list[$key]['constraints']); $list[$key]['depends'] = $constraints['depends']; @@ -924,7 +924,7 @@ * @see removeExtFromList(), addExtToList() */ function removeRequiredExtFromListArr($listArr) { - $requiredExtensions = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'], 1); + $requiredExtensions = t3lib_div::trimExplode(',', t3lib_extMgm::getRequiredExtensionList(), 1); foreach ($listArr as $k => $ext) { if (in_array($ext, $requiredExtensions) || !strcmp($ext, '_CACHEFILE')) { unset($listArr[$k]);