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
Earn up to 15% annual interest with Nexo. Icon
Earn up to 15% annual interest with Nexo.

Let your crypto work for you

Put idle assets to work with competitive interest rates, borrow without selling, and trade with precision. All in one platform. Geographic restrictions, eligibility, and terms apply.
Get started with Nexo.
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