Project

General

Profile

Actions

Feature #17378

closed

Hide dotfiles such as .svn in filelists

Added by Sven Schwyn almost 17 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2007-06-12
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

When browsing a filesystem mount by means of File>Filelist and friends, files beginning with a dot are displayed. When using Subversion, the file lists will therefore be cluttered with .svn directories.

Such dotfiles are usually hidde in Unix environments. It would be great, if TYPO3 could be told to do just that as well.

(issue imported from #M5779)


Files

dotfiles.pdf (4.41 KB) dotfiles.pdf Administrator Admin, 2007-06-12 10:20
patches.tgz (1.52 KB) patches.tgz Administrator Admin, 2007-06-12 17:23
file_ignore-4.1.1.patch.gz (3.22 KB) file_ignore-4.1.1.patch.gz Administrator Admin, 2007-07-12 14:42
file_ignore-4.1.2.patch.gz (3.16 KB) file_ignore-4.1.2.patch.gz Administrator Admin, 2007-07-20 10:16
5779_trunk_file_ignore.diff (8.92 KB) 5779_trunk_file_ignore.diff Administrator Admin, 2008-01-22 23:41
5779_file_ignore_rev6698.diff (8.93 KB) 5779_file_ignore_rev6698.diff Administrator Admin, 2009-12-26 12:45

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Feature #22968: Add a systemwide exclude pattern for t3lib_div::get_dirs() (eg. for .svn directories)ClosedChristian Kuhn2010-06-23

Actions
Actions #1

Updated by Sven Schwyn almost 17 years ago

Here's a possible and tested patch against typo3_src-4.1.1 which covers all occurences of "@dir(" in the core. No more than a handful of lines had to be changed.

1)
Define $TYPO3_CONF_VARS['SYS']['ignoreDotFiles'] = {0|1}

2)
Apply the attached 5 patches.

Actions #2

Updated by Sven Schwyn almost 17 years ago

By the way: It's not possible to hide the dotfiles by means of filesystem permissions only.

Actions #3

Updated by Sven Schwyn over 16 years ago

I have attached "file_ignore-4.1.1.patch.gz" which must be applied against a vanilla typo3_src-4.1.1.

The patch does three things:

1)
It adds $TYPO3_CONF_VARS['SYS']['file_ignore_pattern'] which is described as follows: 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)$/

2)
It adds the method t3lib_div::file_ignore() which compares a filename against the pattern. This method is used in ...

3)
It adds a check such as "!t3lib_div::file_ignore($entry)" to the loops following all "dir" and "opendir" occurences I could find in the core.

Here is a list of files changed, the line numbers are referring to the file after it was patched:

t3lib/class.t3lib_tsparser_ext.php -- 1083
t3lib/class.t3lib_querygenerator.php -- 760
t3lib/class.t3lib_fullsearch.php -- 823
t3lib/class.t3lib_tcemain.php -- 6211
t3lib/class.t3lib_admin.php -- 591
t3lib/class.t3lib_div.php -- 2553, 2578, 2612
typo3/sysext/cms/tslib/class.tslib_content.php -- 3428
typo3/sysext/adodb/adodb/adodb.inc.php -- 1604
typo3/sysext/install/mod/class.tx_install.php -- 1114, 1148
typo3/class.file_list.inc -- 563

There might be conflicting code in the following (unchanged) file:
class.t3lib_superadmin.php -- 963

I've created this patch paid by Unic Internet Solutions. Chances are Unic will sponsor this patch (or another solution for the .svn issue) to make it into the next TYPO3 release. I can tell more about the sponsoring within a few days.

Actions #4

Updated by Sven Schwyn over 16 years ago

I have updated and tested the patch against typo3_src-4.1.2 - you find it attached.

Actions #5

Updated by Steffen Kamper over 16 years ago

Hi,

what's about filtering them out while uploading to TER ?
These files are uninteresting for the users, disk space eaters as well, makes no sense to have them included in t3x files.

Actions #6

Updated by Oliver Klee over 16 years ago

If they are filtered during upload, they should also be filtered when creating the ext_emconf hashes.

Actions #7

Updated by Steffen Kamper over 16 years ago

absolutely!

If i'm right this can be done with
$GLOBALS['TYPO3_CONF_VARS']['EXT']['excludeForPackaging']

I will make some tests with that.

Actions #8

Updated by Sven Schwyn over 16 years ago

@Steffen and Oliver:

Could you clarify what you mean with your notes? I'm not sure we're talking about the same things here.

The patch is hiding dotfiles (most notably ".svn") globally. Although uninteresting to the BE user, they are essential for development and deployment as we do this entirely through Subversion. So simply excluding them from export/creation won't fix anything.

Actions #9

Updated by Oliver Klee over 16 years ago

.svn directories are important when developing, but only if the source code has been checked out from SVN. In the TER, those directories are useless and only take up space and thus should be kept from uploading to the TER and from being used for the hashes in ext_emconf.

Sven, have I been able to shed some light on this issue?

Actions #10

Updated by Sven Schwyn over 16 years ago

@Oliver:
Yep, got your point and it makes perfect sense of course. I guess you mean this in addition to this (or a similar) patch. Thanks for the hint!

Actions #11

Updated by Till Kleisli over 16 years ago

Hi guys

Would be great, if we can have this patch in the next release of TYPO3. :-)

Actions #12

Updated by Bernhard Kraft over 16 years ago

I guess Stefen and Oliver were talking about one thing ... and Sven about another.

Svens aim is to filter out files starting with a "." (dot) in the "Fileadmin" ... File > Filelist ... or probably also in DAM ...

Stefen and Oliver were talking about filtering out those files while uploading an Extension to TER so you do no see those .svn directories when browsing an extensions code using the ExtManager - or when viewing the files on typo3.org ....

I will take care this issue.
(Currently I have no customer project going on - and by that I will fix and commit patches on which sponsorship is set :) ... i hope that is ok for all of you ...

Actions #13

Updated by Dmitry Dulepov over 16 years ago

.htaccess must be visible or it is -1...

Actions #14

Updated by Sven Schwyn over 16 years ago

@Dmitry Dulepov:
The patch I wrote is not hiding all .dotfiles but rather those you specify in localconf.php, thus .htaccess may remain visible by changing this line:

'file_ignore_pattern' => '/^(\..*|CVS)$/',

to:

'file_ignore_pattern' => '/^(\.svn|CVS)$/',

Here's the description:

// 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)$

@Bernhard:
Great, thanks for adopting this issue!

Actions #15

Updated by Till Kleisli about 16 years ago

@Bernhard:
Do you have any news about the inclusion in TYPO3 core?

We have been told by Ingo Renner on 29.10.07, that the target version for this patch would be 4.2.0, but in the actual alpha3, it is not applied.. :-/

Actions #16

Updated by Steffen Kamper about 16 years ago

thx Sven for your initial work.
I created a patch against last trunk, see 5779_trunk_file_ignore.diff

Actions #17

Updated by Steffen Gebert over 14 years ago

Can't we move this setting to UserTS instead of $TYPO3_CONF_VARS['SYS']['ignoreDotFiles'] ?

We already have sooo many options there. UserTS would e.g. enable to hide them only for specific user groups and not for admins.

Actions #18

Updated by Bernhard Kraft over 14 years ago

I've just uploaded a patch against latest trunk revision (6698):

5779_file_ignore_rev6698.diff

I removed the fix for "adodb". I guess it should be a case of the extension admin to take care wheter he wants to hide files mentioned in the pattern.

Actions #19

Updated by Bernhard Kraft about 14 years ago

I guess this patch will not make it into the core.

At least other people object adding such a feature. See thread "RFC #17378: Hide dotfiles such as .svn in filelists" from 2009-12-26 on the core list.

Actions #20

Updated by Sven Schwyn about 14 years ago

Jeez, I completely forgot about this feature request. :-)

@Bernhard: I fully agree with your points on the core list.

However, I've switched to git a long time ago which unlike svn stores all metadata in one .git at root level. If the core devs are too windoze to consider piles of .svn directories a nuisance, I suggest people start to use git instead. (It's way better anyway.)

Actions #21

Updated by Mickaël PERRIN about 14 years ago

We also need such a feature to hide .svn in FileList module.

The use of configuration through UserTSConfig could also be a more flexible way to quickly hide some files patterns to specified user groups than mount points.

I tested the patch and I think there is someting wrong with the use of your new static function ignoreFile. Sometimes, you call t3lib_div::ignoreFile($entry) in tests and something t3lib_div::ignoreFile($entry).

I think all tests have to call t3lib_div::ignoreFile($entry).

Actions #22

Updated by Michael Leibenson over 13 years ago

So, is it fixed? I cannot find such functionality in the latest TYPO3 build.

Actions #23

Updated by Steffen Gebert over 13 years ago

No, it's not fixed (as this report is not "resolved" or closed). You can have a look at the core list archives, at which point the discussion got stuck and bring the topic up again.

Actions #24

Updated by Fedir RYKHTIK almost 13 years ago

Actually, we need several hooks here and, probably, common API to work with files.

Actions #25

Updated by Alexander Opitz over 9 years ago

  • Description updated (diff)
  • Category set to File Abstraction Layer (FAL)
  • Status changed from Accepted to New
  • Assignee deleted (Bernhard Kraft)
  • Target version deleted (0)
  • PHP Version deleted (5.1)
Actions #26

Updated by Benni Mack about 9 years ago

  • Status changed from New to Closed

Hey,

we got the common API, we got the option (default to hide dotfiles such as .svn files) to hide/unhide these files on a per BE user level!

Actions

Also available in: Atom PDF