HM\BackUpWordPress\File_Backup_Engine::get_files PHP Method

get_files() public method

By default we ignore unreadable files and directories as well as, common version control folders / files, "Dot" files and anything matching the exclude rules.
public get_files ( ) : SplFileInfo[]
return SplFileInfo[] The array of all files to be included
    public function get_files()
    {
        $finder = new Finder();
        $finder->followLinks();
        // defaults to true
        $finder->ignoreDotFiles(false);
        $finder->ignoreVCS(true);
        $finder->ignoreUnreadableDirs(true);
        // Skip unreadable files too
        $finder->filter(function (\SplFileInfo $file) {
            if (!$file->isReadable()) {
                return false;
            }
        });
        // Finder expects exclude rules to be in a regex format
        $exclude_rules = $this->excludes->get_excludes_for_regex();
        // Skips folders/files that match default exclude patterns
        foreach ($exclude_rules as $exclude) {
            $finder->notPath($exclude);
        }
        return $finder->in(Path::get_root());
    }