thiagobarros2 / file-counter
A simple way to test how many files are into a given dir based on extension
Installs: 6 023
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^8.2
Requires (Dev)
- pestphp/pest: ^2.28.0
- pestphp/pest-dev-tools: ^2.16.0
- pestphp/pest-plugin: ^2.1.1
README
# development $ composer require thiagobarros2/file-counter --dev # production $ composer require thiagobarros2/file-counter # warning: this package can be of course used in production but was thought to be a dev-dependency
Usage
<?php namespace src; use ThiagoBarros\FileCounter\Counter; function yourFunction() { $number_of_files = Counter::number_of_files('path_to_dir', 'file_extension'); //the file_extension param can be provided with or without '.' return $number_of_files; }); <?php namespace src; use ThiagoBarros\FileCounter\Lister; function yourFunction() { $files_by_extension = Lister::files_by_extension('path_to_dir'); return $files_by_extension; });