Bug #16419 » exclude-in-EM.patch

Administrator Admin, 2006-10-14 10:36

View differences:

t3lib/config_default.php (working copy)
97 97
		'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.
98 98

  
99 99
		'requiredExt' => 'cms,version,lang,sv',			// String list: List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
100
		'excludeFilesForPackaging' => '',		// String list: List of files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. No wildcards possible.
101
		'excludeDirectoriesForPackaging' => 'CVS,.svn',		// String list: List of directories which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. No wildcards possible.
100 102
		'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...)
101 103
		'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!
102 104
		'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)
2555 2555
	 * @param	string		$extensionList is the comma list of extensions to read only (blank = all)
2556 2556
	 * @param	boolean		If set, then the path is prepended the filenames. Otherwise only the filenames are returned in the array
2557 2557
	 * @param	string		$order is sorting: 1= sort alphabetically, 'mtime' = sort by modification time.
2558
	 * @param string		A comma seperated list of filenames to exclude, no wildcards
2558 2559
	 * @return	array		Array of the files found
2559 2560
	 */
2560
	function getFilesInDir($path,$extensionList='',$prependPath=0,$order='')	{
2561
	function getFilesInDir($path,$extensionList='',$prependPath=0,$order='',$excludeFiles='')	{
2561 2562

  
2562 2563
			// Initialize variabels:
2563 2564
		$filearray = array();
......
2573 2574
					if (@is_file($path.'/'.$entry))	{
2574 2575
						$fI = pathinfo($entry);
2575 2576
						$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)
2576
						if (!$extensionList || t3lib_div::inList($extensionList,strtolower($fI['extension'])))	{
2577
						if (!$extensionList || t3lib_div::inList($extensionList,strtolower($fI['extension'])) && !t3lib_div::inList($excludeFiles,strtolower($entry)))	{
2577 2578
						    $filearray[$key]=($prependPath?$path.'/':'').$entry;
2578
							if ($order=='mtime') {$sortarray[$key]=filemtime($path.'/'.$entry);}
2579
								if ($order=='mtime') {$sortarray[$key]=filemtime($path.'/'.$entry);}
2579 2580
								elseif ($order)	{$sortarray[$key]=$entry;}
2580 2581
						}
2581 2582
					}
......
2611 2612
	 * @param	integer		$recursivityLevels: The number of levels to dig down...
2612 2613
	 * @return	array		An array with the found files/directories.
2613 2614
	 */
2614
	function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99)	{
2615
	function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99,$excludeFiles='',$excludeDirs='')	{
2615 2616
		if ($regDirs)	$fileArr[] = $path;
2616
		$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($path,$extList,1,1));
2617
		$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($path,$extList,1,1,$excludeFiles));
2617 2618

  
2618 2619
		$dirs = t3lib_div::get_dirs($path);
2619 2620
		if (is_array($dirs) && $recursivityLevels>0)	{
2620 2621
			foreach ($dirs as $subdirs)	{
2621
				if ((string)$subdirs!='')	{
2622
					$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$path.$subdirs.'/',$extList,$regDirs,$recursivityLevels-1);
2622
				if ((string)$subdirs!='' && !t3lib_div::inList($excludeDirs,strtolower($subdirs)))	{
2623
					$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$path.$subdirs.'/',$extList,$regDirs,$recursivityLevels-1,$excludeFiles,$excludeDirs);
2623 2624
				}
2624 2625
			}
2625 2626
		}
typo3/mod/tools/em/class.em_index.php (working copy)
351 351
			'L' => '../../../../'.TYPO3_mainDir
352 352
		);
353 353

  
354
		// Setting module configuration:
354
		$this->excludeFilesForPackaging = $GLOBALS['TYPO3_CONF_VARS']['EXT']['excludeFilesForPackaging'];
355
		$this->excludeDirectoriesForPackaging = $GLOBALS['TYPO3_CONF_VARS']['EXT']['excludeDirectoriesForPackaging'];
356

  
357
			// Setting module configuration:
355 358
		$this->MCONF = $GLOBALS['MCONF'];
356 359

  
357
		// Setting GPvars:
360
			// Setting GPvars:
358 361
		$this->CMD = t3lib_div::_GP('CMD');
359 362
		$this->lookUpStr = trim(t3lib_div::_GP('_lookUp'));
360 363
		$this->listRemote = t3lib_div::_GP('ter_connect');
......
2266 2271
		if ($extPath)	{
2267 2272
			// Read files:
2268 2273
			$fileArr = array();
2269
			$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath);
2274
			$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath,'',0,99,$this->excludeFilesForPackaging,$this->excludeDirectoriesForPackaging);
2270 2275

  
2271 2276
			// Start table:
2272 2277
			$lines = array();
......
3338 3343
	 * @see makeDetailedExtensionAnalysis()
3339 3344
	 */
3340 3345
	function getClassIndexLocallangFiles($absPath,$table_class_prefix,$extKey)	{
3341
		$filesInside = t3lib_div::removePrefixPathFromList(t3lib_div::getAllFilesAndFoldersInPath(array(),$absPath,'php,inc'),$absPath);
3346
		$filesInside = t3lib_div::removePrefixPathFromList(t3lib_div::getAllFilesAndFoldersInPath(array(),$absPath,'php,inc',0,99,$this->excludeFilesForPackaging,$this->excludeDirectoriesForPackaging),$absPath);
3342 3347
		$out = array();
3343 3348

  
3344 3349
		foreach($filesInside as $fileName)	{
......
3883 3888

  
3884 3889
			// Get files for extension:
3885 3890
			$fileArr = array();
3886
			$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath);
3891
			$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr,$extPath,'',0,99,$this->excludeFilesForPackaging,$this->excludeDirectoriesForPackaging);
3887 3892

  
3888 3893
			// Calculate the total size of those files:
3889 3894
			$totalSize = 0;
(7-7/9)