Project

General

Profile

Feature #20717 » 11474.diff

Administrator Admin, 2009-07-04 20:29

View differences:

t3lib/class.t3lib_extmgm.php (working copy)
global $TYPO3_CONF_VARS;
// Full list of extensions includes both required and extList:
$rawExtList = $TYPO3_CONF_VARS['EXT']['requiredExt'].','.$TYPO3_CONF_VARS['EXT']['extList'];
/**
* Select mode how to load extensions in order to speed up the FE
*/
if (TYPO3_MODE == 'FE') {
$extLoadInContext = $TYPO3_CONF_VARS['EXT']['extList_FE'];
$cacheFileSuffix = '_FE';
} else {
$extLoadInContext = $TYPO3_CONF_VARS['EXT']['extList'];
// Works as before
$cacheFileSuffix = '';
}
$rawExtList = $TYPO3_CONF_VARS['EXT']['requiredExt'].','.$extLoadInContext;
// Empty array as a start.
$extensions = array();
......
//
if ($rawExtList) {
// The cached File prefix.
$cacheFilePrefix = 'temp_CACHED';
$cacheFilePrefix = 'temp_CACHED' . $cacheFileSuffix;
// Setting the name for the cache files:
if (intval($TYPO3_CONF_VARS['EXT']['extCache'])==1) $cacheFilePrefix.= '_ps'.substr(t3lib_div::shortMD5(PATH_site.'|'.$GLOBALS['TYPO_VERSION']), 0, 4);
if (intval($TYPO3_CONF_VARS['EXT']['extCache'])==2) $cacheFilePrefix.= '_'.t3lib_div::shortMD5($rawExtList);
......
} else { // ... but if not, configure...
// Prepare reserved filenames:
$files = t3lib_div::trimExplode(',', 'ext_localconf.php,ext_tables.php,ext_tables.sql,ext_tables_static+adt.sql,ext_typoscript_constants.txt,ext_typoscript_editorcfg.txt,ext_typoscript_setup.txt', 1);
$files = array('ext_localconf.php','ext_tables.php','ext_tables.sql','ext_tables_static+adt.sql','ext_typoscript_constants.txt','ext_typoscript_editorcfg.txt','ext_typoscript_setup.txt');
// Traverse extensions and check their existence:
clearstatcache(); // Clear file state cache to make sure we get good results from is_dir()
$temp_extensions = array_unique(t3lib_div::trimExplode(',', $rawExtList, 1));
typo3/mod/tools/em/class.em_index.php (working copy)
*/
function writeNewExtensionList($newExtList) {
global $TYPO3_CONF_VARS;
$strippedExtensionList = $this->stripNonFrontendExtensions($newExtList);
// Instance of install tool
$instObj = new t3lib_install;
......
// Get lines from localconf file
$lines = $instObj->writeToLocalconf_control();
$instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
$instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList_FE\']', $strippedExtensionList);
$instObj->writeToLocalconf_control($lines);
$TYPO3_CONF_VARS['EXT']['extList'] = $newExtList;
$TYPO3_CONF_VARS['EXT']['extList_FE'] = $strippedExtensionList;
$this->removeCacheFiles();
}
/**
* Removes unneeded extensions from the frontend based on
* EMCONF doNotLoadInFE = 1
*
* @param string $extList
* @return string
*/
function stripNonFrontendExtensions($extList) {
$fullExtList = $this->getInstalledExtensions();
#t3lib_div::devLog('Init','mattes','1',$fullExtList);
$extListArray = t3lib_div::trimExplode(',', $extList);
foreach ($extListArray as $arrayKey => $extKey) {
#t3lib_div::devLog('LOOP from Mattes','mattes','1',$fullExtList[0][$extKey]);
if ($fullExtList[0][$extKey]['EM_CONF']['doNotLoadInFE'] == 1) {
unset($extListArray[$arrayKey]);
}
}
$nonFEList = implode(',', $extListArray);
return $nonFEList;
}
/**
* Writes the TSstyleconf values to "localconf.php"
(1-1/2)