New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

thiagobarros2/file-counter

A simple way to test how many files are into a given dir based on extension
8,819
Install
composer require thiagobarros2/file-counter
Latest Version:v1.3.0
PHP:^8.2
License:MIT
Last Updated:Feb 3, 2024
Links: GitHub  ·  Packagist
Maintainer: thiagobarros2

Instalation

# 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;
});

Related Packages

pestphp/pest-plugin-stressless

Stressless plugin for Pest

1,358,012 67
erikgaal/pest-plugin-sharding

Pest Plugin to split tests into multiple runs

614,369 2
lukeraymonddowning/pest-plugin-money

A Pest PHP plugin that makes testing popular Money packages easy.

69,939 21

Version History

Version Released PHP License
v1.3.0 ^8.2 MIT
v1.2.0 ^8.2 MIT
v1.1.0 ^8.1 MIT
v1.0.0 ^8.1 MIT