Project

General

Profile

Feature #17378 » 5779_trunk_file_ignore.diff

Administrator Admin, 2008-01-22 23:41

View differences:

t3lib/class.t3lib_admin.php (working copy)
if (@is_dir($path)) {
$d = dir($path);
while($entry=$d->read()) {
if (@is_file($path.'/'.$entry)) {
if ( @is_file($path.'/'.$entry) && !t3lib_div::file_ignore($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_div.php (working copy)
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']['file_ignore_pattern'].
*
* @param string Name of the file or directory.
* @return boolean Returns true if the file or directory should be ignored, false otherwise.
*/
function file_ignore($file) {
global $TYPO3_CONF_VARS;
return ($TYPO3_CONF_VARS['SYS']['file_ignore_pattern'] && preg_match($TYPO3_CONF_VARS['SYS']['file_ignore_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
......
$d = @dir($path);
if (is_object($d)) {
while($entry=$d->read()) {
if (@is_dir($path.'/'.$entry) && $entry!= '..' && $entry!= '.') {
if (@is_dir($path.'/'.$entry) && $entry!= '..' && $entry!= '.' && !t3lib_div::file_ignore($entry)) {
$filearray[]=$entry;
}
}
......
$d = dir($path);
if (is_object($d)) {
while($entry=$d->read()) {
if (@is_file($path.'/'.$entry)) {
if (@is_file($path.'/'.$entry) && t3lib_div::file_ignore($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 (working copy)
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::file_ignore($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_querygenerator.php (working copy)
}
$d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']);
while (false !== ($entry=$d->read())) {
if ($entry=='.' || $entry=='..') {
if ($entry=='.' || $entry=='..' || t3lib_div::file_ignore($entry)) {
continue;
}
$fileArray[] = $entry;
t3lib/class.t3lib_tsparser_ext.php (working copy)
$tempArray=Array();
if (is_object($d)) {
while($entry=$d->read()) {
if ($entry!="." && $entry!="..") {
if ($entry!="." && $entry!=".." && !t3lib_div::file_ignore($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)) {
$fI = t3lib_div::split_fileref($wholePath);
t3lib/config_default.php (working copy)
'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.
'file_ignore_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)$/
'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' => 0, // 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.
),
typo3/class.file_list.inc (working copy)
$tempArray=Array();
if (is_object($d)) {
while($entry=$d->read()) {
if ($entry!='.' && $entry!='..') {
if ($entry!='.' && $entry!='..' && !t3lib_div::file_ignore($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) {
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.file_list.inc']);
}
?>
?>
typo3/sysext/adodb/adodb/adodb.inc.php (working copy)
if(!$dh = @opendir($dir)) return;
while (($obj = readdir($dh))) {
if($obj=='.' || $obj=='..')
if($obj=='.' || $obj=='..' || t3lib_div::file_ignore($obj))
continue;
if (!@unlink($dir.'/'.$obj))
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
if (is_object($d)) {
$count=0;
while($entry=$d->read()) {
if ($entry!='.' && $entry!='..') {
if ($entry!='.' && $entry!='..' && !t3lib_div::file_ignore($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);
(5-5/6)