Project

General

Profile

Feature #17378 » 5779_file_ignore_rev6698.diff

Administrator Admin, 2009-12-26 12:45

View differences:

t3lib/config_default.php (Arbeitskopie)
'serverTimeZone' => 1, // Integer, GMT offset of servers time (from time()). Default is "1" which is "GMT+1" (central european time). This value can be used in extensions that are GMT aware and wants to convert times to/from other timezones.
'systemLog' => '', // String, semi-colon separated list: Defines one or more logging methods. Possible methods: file,<abs-path-to-file>[,<level>];mail,<to>[/<from>][,<level>];syslog,<facility>,[,<level>];error_log[,,<level>]. "file" logs to a file, "mail" sends the log entries via mail, "syslog" uses the operating system's log, "error_log" uses the PHP error log. The level is the individual logging level (see [SYS][systemLogLevel]. Facility may be one of LOCAL0..LOCAL7, USER (on Windows USER is the only valid type).
'systemLogLevel' => 0, // Integer: Only messages with same or higher severity are logged; 0 is info, 1 is notice, 2 is warning, 3 is error, 4 is fatal error.
'ignore_file_pattern' => '/^(\..*|CVS)$/', // String: Files and directories (including their contents) that match this Perl compatible regular expression (preg_match) are ignored for all file operations such as the filelist or the extension manager. Please note that this should only be used for metadata containers such as ".svn" and friends. If you ignore documents such as "image.gif", you will experience strange cache behaviour. The following example ignores all files and directories starting with a "." (thus including ".svn") as well as those named "CVS": /^(\..*|CVS)$/
'enableDeprecationLog' => TRUE, // Boolean: Enables the logging of deprecated methods and functions. The log file will be written to typo3conf/deprecation_[hash-value].log
'maxFileNameLength' => 60, // Integer, This is the maximum file name length. The value will be taken into account by basic file operations like renaming or creation of files and folders.
'UTF8filesystem' => FALSE, // Boolean: If true and [BE][forceCharset] is set to utf-8, then TYPO3 uses utf-8 to store file names. This allows for accented Latin letters as well as any other non-latin characters like Cyrillic and Chinese.
t3lib/class.t3lib_admin.php (Arbeitskopie)
if (@is_dir($path)) {
$d = dir($path);
while($entry=$d->read()) {
if (@is_file($path.'/'.$entry)) {
if ( @is_file($path.'/'.$entry) && !t3lib_div::ignoreFile($entry) ) {
if (isset($fileArr[$entry])) {
if ($fileArr[$entry] > 1) {
$temp = $this->whereIsFileReferenced($folder,$entry);
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_admin.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_admin.php']);
}
?>
?>
t3lib/class.t3lib_querygenerator.php (Arbeitskopie)
}
$d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']);
while (false !== ($entry=$d->read())) {
if ($entry=='.' || $entry=='..') {
if ($entry=='.' || $entry=='..' || t3lib_div::ignoreFile($entry)) {
continue;
}
$fileArray[] = $entry;
t3lib/class.t3lib_div.php (Arbeitskopie)
return $OK;
}
/**
* Checks whether a file or directory is supposed to be ignored.
* The pattern files and directories are compared with is set in $TYPO3_CONF_VARS['SYS']['ignore_file_pattern'].
*
* @param string Name of the file or directory.
* @return boolean Returns true if the file or directory should be ignored, false otherwise.
*/
function ignoreFile($file) {
global $TYPO3_CONF_VARS;
return ($TYPO3_CONF_VARS['SYS']['ignore_file_pattern'] && preg_match($TYPO3_CONF_VARS['SYS']['ignore_file_pattern'], $file));
}
/**
* Returns an array with the names of folders in a specific path
* Will return 'error' (string) if there were an error with reading directory content.
* Usage: 11
......
$dir = scandir($path);
$dirs = array();
foreach ($dir as $entry) {
if (is_dir($path . '/' . $entry) && $entry != '..' && $entry != '.') {
if (is_dir($path . '/' . $entry) && $entry != '..' && $entry != '.' && !t3lib_div::ignoreFile($entry)) {
$dirs[] = $entry;
}
}
......
$d = dir($path);
if (is_object($d)) {
while($entry=$d->read()) {
if (@is_file($path.'/'.$entry)) {
if (@is_file($path.'/'.$entry) && t3lib_div::ignoreFile($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 ((!strlen($extensionList) || t3lib_div::inList($extensionList,strtolower($fI['extension']))) && (!strlen($excludePattern) || !preg_match('/^'.$excludePattern.'$/',$entry))) {
......
}
}
?>
?>
t3lib/class.t3lib_fullsearch.php (Arbeitskopie)
if ($fieldSetup['type'] == 'files') {
$d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']);
while (false !== ($entry = $d->read())) {
if ($entry == '.' || $entry == '..') {
if ($entry == '.' || $entry == '..' || t3lib_div::ignoreFile($entry)) {
continue;
}
$fileArray[] = $entry;
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']);
}
?>
?>
t3lib/class.t3lib_tsparser_ext.php (Arbeitskopie)
* @param [type] $type: ...
* @return [type] ...
*/
function readDirectory($path,$type='file') {
if(@is_dir($path)) {
function readDirectory($path,$type='file') {
if(@is_dir($path)) {
$d = @dir($path);
$tempArray=Array();
if (is_object($d)) {
if (is_object($d)) {
while($entry=$d->read()) {
if ($entry!='.' && $entry!='..') {
if ($entry!='.' && $entry!='..' && !t3lib_div::ignoreFile($entry)) {
$wholePath = $path.'/'.$entry; // Because of odd PHP-error where <BR>-tag is sometimes placed after a filename!!
if (file_exists($wholePath) && (!$type || filetype($wholePath)==$type)) {
if (file_exists($wholePath) && (!$type || filetype($wholePath)==$type)) {
$fI = t3lib_div::split_fileref($wholePath);
$this->dirResources[]=substr($wholePath,strlen(PATH_site));
}
......
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser_ext.php']);
}
?>
?>
typo3/class.file_list.inc (Arbeitskopie)
$tempArray=Array();
if (is_object($d)) {
while(false !== ($entry=$d->read())) {
if ($entry!='.' && $entry!='..') {
if ($entry!='.' && $entry!='..' && !t3lib_div::ignoreFile($entry)) {
$wholePath = $path.'/'.$entry; // Because of odd PHP-error where <br />-tag is sometimes placed after a filename!!
if (@file_exists($wholePath) && (!$type || t3lib_div::inList($type,filetype($wholePath)))) {
if ($extList) {
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
if (is_object($d)) {
$count=0;
while($entry=$d->read()) {
if ($entry!='.' && $entry!='..') {
if ($entry!='.' && $entry!='..' && !t3lib_div::ignoreFile($entry)) {
$wholePath = $path.'/'.$entry; // Because of odd PHP-error where <br />-tag is sometimes placed after a filename!!
if (file_exists($wholePath) && filetype($wholePath)=='file') {
$info = t3lib_div::split_fileref($wholePath);
(6-6/6)