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
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
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