PHP Classes

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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (20)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 89 All time: 9,914 This week: 191Up
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  
Name: DeGraciaMathieu <contact>
Classes: 15 packages by
Country: France France
Age: ???
All time rank: 297981 in France France
Week rank: 346 Up15 in France France Up
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

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  
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

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file build.yml Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file File.php Class Class source
  Plain text file FileFinder.php Class Class source
  Plain text file FileHelper.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageUnit (3 files, 2 directories)

  Files folder image Files  /  tests  /  Unit  
File Role Description
Files folder imageAssets (4 files)
Files folder imageAssets2 (2 files, 1 directory)
  Plain text file FileFinderTest.php Class Class source
  Plain text file FileHelperTest.php Class Class source
  Plain text file FileTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  /  Assets  
File Role Description
  Plain text file Bar.php Class Class source
  Plain text file Baz.php Class Class source
  Plain text file Foo.php Class Class source
  Plain text file Qux.inc Class Class source

  Files folder image Files  /  tests  /  Unit  /  Assets2  
File Role Description
Files folder imageDeepAssets (3 files)
  Plain text file Foo2.php Class Class source
  Plain text file Qux2.inc Class Class source

  Files folder image Files  /  tests  /  Unit  /  Assets2  /  DeepAssets  
File Role Description
  Plain text file Deep.php Class Class source
  Plain text file Deep2.php Class Class source
  Plain text file Different.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:89
This week:0
All time:9,914
This week:191Up