Project

General

Profile

Feature #20717 » 11474_v2.diff

Administrator Admin, 2009-07-14 18:53

View differences:

t3lib/class.t3lib_extmgm.php (Arbeitskopie)
public static function typo3_loadExtensions() {
global $TYPO3_CONF_VARS;
// Select mode how to load extensions in order to speed up the FE
if (TYPO3_MODE == 'FE') {
if (!($extLoadInContext = $TYPO3_CONF_VARS['EXT']['extList_FE'])) {
// fall back to standard 'extList' if 'extList_FE' is not (yet) set
$extLoadInContext = $TYPO3_CONF_VARS['EXT']['extList'];
}
$cacheFileSuffix = '_FE';
} else {
$extLoadInContext = $TYPO3_CONF_VARS['EXT']['extList'];
// Works as before
$cacheFileSuffix = '';
}
// Full list of extensions includes both required and extList:
$rawExtList = $TYPO3_CONF_VARS['EXT']['requiredExt'].','.$TYPO3_CONF_VARS['EXT']['extList'];
$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));
......
* @internal
*/
public static function currentCacheFiles() {
global $TYPO3_LOADED_EXT;
if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
if (t3lib_extMgm::isCacheFilesAvailable($TYPO3_LOADED_EXT['_CACHEFILE'])) {
return array(
PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_localconf.php',
PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_tables.php'
);
if (($cacheFilePrefix = $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'])) {
$cacheFilePrefixFE = str_replace('temp_CACHED','temp_CACHED_FE',$cacheFilePrefix);
$files = array();
if (t3lib_extMgm::isCacheFilesAvailable($cacheFilePrefix)) {
$files[] = PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php';
$files[] = PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php';
}
if (t3lib_extMgm::isCacheFilesAvailable($cacheFilePrefixFE)) {
$files[] = PATH_typo3conf.$cacheFilePrefixFE.'_ext_localconf.php';
$files[] = PATH_typo3conf.$cacheFilePrefixFE.'_ext_tables.php';
}
if (!empty($files)) {
return $files;
}
}
}
typo3/mod/tools/em/class.em_index.php (Arbeitskopie)
function writeNewExtensionList($newExtList) {
global $TYPO3_CONF_VARS;
$strippedExtensionList = $this->stripNonFrontendExtensions($newExtList);
// Instance of install tool
$instObj = new t3lib_install;
$instObj->allowUpdateLocalConf =1;
......
// 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();
$extListArray = t3lib_div::trimExplode(',', $extList);
foreach ($extListArray as $arrayKey => $extKey) {
if ($fullExtList[0][$extKey]['EM_CONF']['doNotLoadInFE'] == 1) {
unset($extListArray[$arrayKey]);
}
}
$nonFEList = implode(',', $extListArray);
return $nonFEList;
}
/**
* Writes the TSstyleconf values to "localconf.php"
* Removes the temp_CACHED* files before return.
*
(2-2/2)