Project

General

Profile

Bug #16419 » exclude-in-EM-v2.patch

Administrator Admin, 2006-10-19 22:50

View differences:

t3lib/config_default.php (working copy)
'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,version,lang,sv', // String list: List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
'excludeForPackaging' => '(CVS|\..*|.*~)', // String list: 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, // Int. 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' => 'tsconfig_help,context_help,extra_page_cm_options,impexp,belog,aboutmodules,setup,install', // String list: List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
'extConf' => array( // Config-options for extensions, stored as serialized arrays by extension-keys. Handled automatically by the EM.
t3lib/class.t3lib_div.php (working copy)
* @param string $extensionList is the comma list of extensions to read only (blank = all)
* @param boolean If set, then the path is prepended the filenames. Otherwise only the filenames are returned in the array
* @param string $order is sorting: 1= sort alphabetically, 'mtime' = sort by modification time.
* @param string A comma seperated list of filenames to exclude, no wildcards
* @return array Array of the files found
*/
function getFilesInDir($path,$extensionList='',$prependPath=0,$order='') {
function getFilesInDir($path,$extensionList='',$prependPath=0,$order='',$excludePattern='') {
// Initialize variabels:
$filearray = array();
......
if (@is_file($path.'/'.$entry)) {
$fI = pathinfo($entry);
$key = md5($path.'/'.$entry); // Don't change this ever - extensions may depend on the fact that the hash is an md5 of the path! (import/export extension)
if (!$extensionList || t3lib_div::inList($extensionList,strtolower($fI['extension']))) {
if (!$extensionList || t3lib_div::inList($extensionList,strtolower($fI['extension'])) && (strlen($excludePattern) && !preg_match('/^'.$excludePattern.'$/',$entry))) {
$filearray[$key]=($prependPath?$path.'/':'').$entry;
if ($order=='mtime') {$sortarray[$key]=filemtime($path.'/'.$entry);}
if ($order=='mtime') {$sortarray[$key]=filemtime($path.'/'.$entry);}
elseif ($order) {$sortarray[$key]=$entry;}
}
}
......
* @param string $extList: Comma list of file extensions: Only files with extensions in this list (if applicable) will be selected.
* @param boolean $regDirs: If set, directories are also included in output.
* @param integer $recursivityLevels: The number of levels to dig down...
* @param string $excludePattern: regex pattern of files/directories to exclude
* @return array An array with the found files/directories.
*/
function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99) {
function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99,$excludePattern='') {
if ($regDirs) $fileArr[] = $path;
$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($path,$extList,1,1));
$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($path,$extList,1,1,$excludePattern));
$dirs = t3lib_div::get_dirs($path);
if (is_array($dirs) && $recursivityLevels>0) {
foreach ($dirs as $subdirs) {
if ((string)$subdirs!='') {
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$path.$subdirs.'/',$extList,$regDirs,$recursivityLevels-1);
if ((string)$subdirs!='' && (strlen($excludePattern) && !preg_match('/^'.$excludePattern.'$/',$subdirs))) {
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$path.$subdirs.'/',$extList,$regDirs,$recursivityLevels-1,$excludePattern);
}
}
}
typo3/mod/tools/em/class.em_index.php (working copy)
function init() {
global $BE_USER,$LANG,$BACK_PATH,$TYPO3_CONF_VARS;
// Setting paths of install scopes:
// Setting paths of install scopes:
$this->typePaths = Array (
'S' => TYPO3_mainDir.'sysext/',
'G' => TYPO3_mainDir.'ext/',
......
'L' => '../../../../'.TYPO3_mainDir
);
// Setting module configuration:
$this->excludeForPackaging = $GLOBALS['TYPO3_CONF_VARS']['EXT']['excludeForPackaging'];
// Setting module configuration:
$this->MCONF = $GLOBALS['MCONF'];
// Setting GPvars:
// Setting GPvars:
$this->CMD = t3lib_div::_GP('CMD');
$this->lookUpStr = trim(t3lib_div::_GP('_lookUp'));
$this->listRemote = t3lib_div::_GP('ter_connect');
......
if ($extPath) {
// Read files:
$fileArr = array();
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath);
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath,'',0,99,$this->excludeForPackaging);
// Start table:
$lines = array();
......
* @see makeDetailedExtensionAnalysis()
*/
function getClassIndexLocallangFiles($absPath,$table_class_prefix,$extKey) {
$filesInside = t3lib_div::removePrefixPathFromList(t3lib_div::getAllFilesAndFoldersInPath(array(),$absPath,'php,inc'),$absPath);
$filesInside = t3lib_div::removePrefixPathFromList(t3lib_div::getAllFilesAndFoldersInPath(array(),$absPath,'php,inc',0,99,$this->excludeForPackaging),$absPath);
$out = array();
foreach($filesInside as $fileName) {
......
// Get files for extension:
$fileArr = array();
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath);
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath,'',0,99,$this->excludeForPackaging);
// Calculate the total size of those files:
$totalSize = 0;
(8-8/9)