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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
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