PHP Classes

PHP File Explorer: Find files that match a given criteria in a folder

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 92 This week: 1All time: 9,923 This week: 42Up
Version License PHP version Categories
php-file-explorer 1.0The PHP License5PHP 5, Files and Folders, Searching
Description 

Author

This package can find files that match the given criteria in a folder.

It can scan a folder recursively to search for files that match a given file name extension.

It can also exclude specific files with names that match a regular expression

The package can return an array of files that match the criteria.

Picture of DeGraciaMathieu
  Performance   Level  
Innovation award
Innovation award
Nominee: 16x

Winner: 2x

 

Documentation

PHP Composer packagist) packagist)

php-file-explorer

Code extracted from bmitch/churn-php

Usage

$fileFinder = new FileFinder(
    fileExtensions: ['php'], 
    filesToIgnore: [], 
    basePath: __DIR__,
);

$files = $fileFinder->getFiles(paths: [
   __DIR__,
]);

foreach ($files as $file) {
   $file->getFullPath();
   $file->getDisplayPath();
}

Tests

make test
make coverage

  Files folder image Files (20)  
File Role Description
Files folder image.github (1 directory)
Files folder imagesrc (3 files)
Files folder imagetests (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file Makefile Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:92
This week:1
All time:9,923
This week:42Up