symfonysymfony-finder

Symfony Finder ignores files beginning by dot


I am using the Finder for sending spooled e-mails, but automatic name generator puts dots in the filename and sometimes they appear at the beginning of the file.

It seems that the finder can't get files with that name - well those files are hidden... Has anyone experienced that behaviour? Any advice how to use the finder to locate hidden files?

Thx


Solution

  • Just set ignoreDotFiles to false.

    $finder = new Finder();
    $finder->files()->ignoreDotFiles(false)->in('directory');
    

    For .git files, set ignoreVCS to false

    $finder->files()
        ->ignoreVCS(false)
        ->ignoreDotFiles(false)->in('directory');