The Finder component finds files and directories based on different criteria (name, file size, modification time, etc.) via an intuitive fluent interface. If you install this component outside of a Symfony application, you must require the vendor/autoload.php file in your code to enable the class autoloading mechanism provided by Composer. The $file variable is an instance of Symfony\Component\Finder\SplFileInfo which extends PHP’s own SplFileInfo to provide methods to work with relative paths. The Finder object doesn’t reset its internal state automatically. This means that you need to create a new instance if you do not want to get mixed results. The component provides lots of methods to define the search criteria. They all can be chained because they implement a fluent interface. The location is the only mandatory criteria. It tells the finder which directory to use for the search.

Features

  • By default, the Finder returns both files and directories
  • If the search directory contains a .gitignore file, you can reuse those rules to exclude files and directories from the results
  • Multiple filenames can be defined by chaining calls or passing an array
  • Multiple filenames can be excluded by chaining calls or passing an array
  • Internally, strings are converted into regular expressions by escaping slashes and adding delimiters
  • By default, the Finder recursively traverses directories

Project Samples

Project Activity

See All Activity >

Categories

File Managers

License

MIT License

Follow Finder Component

Finder Component Web Site

Other Useful Business Software
Stay in Flow. Let Zenflow Handle the Heavy Lifting. Icon
Stay in Flow. Let Zenflow Handle the Heavy Lifting.

Your AI engineering control center. Zenflow turns specs into shipped features using parallel agents and multi-repo intelligence.

Zenflow is your engineering control center, turning specs into shipped features. Parallel agents handle coding, testing, and refactoring with real repo context. Multi-agent workflows remove bottlenecks and automate routine work so developers stay focused and in flow.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Finder Component!

Additional Project Details

Programming Language

PHP

Related Categories

PHP File Managers

Registered

2021-07-21