With more people using subversion for version control, drupal should not by default recurse into subversion working base directories, just like it does not recurse into CVS directories. simpletest complained about redeclaring ogpost when I tried to start it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChrisKennedy’s picture

Version: x.y.z » 5.x-dev

What about modifying file_scan_directory so that it doesn't traverse any directories beginning with a period?

Dries’s picture

If we add .svn, we might as well want to add .darcs. :)

ChrisKennedy’s picture

FileSize
1.65 KB

Attached patch adds $omit_hidden as the final parameter to file_scan_directory(), defaulting to TRUE, in which case it ignores all files/directories beginning with a period. Modules that want to store data in hidden directories/files can set the flag to FALSE.

This would also fix hidden files with ._ prefix show on module list.

Allie Micka’s picture

Great big +1 on hiding .* files.

Is there a compelling reason to add the $omit_hidden flag? I can't think of a viable use case for wanting to see files that are supposed to be hidden?

ChrisKennedy’s picture

It seems possible that a module would want to keep security-related information in a hidden file, or to keep temporary files in a hidden directory. But removing the flag is also fine with me if that level of customization isn't needed.

dman’s picture

I already tweaked it to do so (skip .directories) for my filebrowser extensions work.
Did so by changing the default exclusion pattern. You can overr-ride it by explicitly giving a blank exclusion pattern

Dries’s picture

-1 on the extra parameter. Why can probably always hide these.

ChrisKennedy’s picture

FileSize
1009 bytes

Sounds good - I only added the parameter because I thought it would get more complaints otherwise. Here is the revised patch.

ChrisKennedy’s picture

I just realized that the $omit_hidden patch neglected to pass omit_hidden to recursive calls, so we averted a problem anyway.

Dries’s picture

Status: Needs review » Fixed

Extended the documentation a little and committed the patch to CVS HEAD.

killes@www.drop.org’s picture

backported

Anonymous’s picture

Status: Fixed » Closed (fixed)