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
Secure File Transfer for Windows with Cerberus by Redwood Icon
Secure File Transfer for Windows with Cerberus by Redwood

Protect and share files over FTP/S, SFTP, HTTPS and SCP with the #1 rated Windows file transfer server.

Cerberus supports unlimited users and connections on a single IP, with built-in encryption, 2FA, and a browser-based web client — all deployable in under 15 minutes with a 25-day free trial.
Try for 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