PHPackages                             jc21/filelist - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jc21/filelist

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

jc21/filelist
=============

File Listing helper class

1.1(10y ago)11.1kBSDPHPPHP &gt;=5.3.0

Since Jun 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jc21/filelist)[ Packagist](https://packagist.org/packages/jc21/filelist)[ Docs](https://github.com/jc21/filelist)[ RSS](/packages/jc21-filelist/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

File Listing helper class for PHP
=================================

[](#file-listing-helper-class-for-php)

- List files from a directory
- Filter for only directories, files or file types
- Sort and limit the listing items

### Installing via Composer

[](#installing-via-composer)

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version:

```
composer.phar require jc21/filelist
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

### Using

[](#using)

```
use jc21\FileList;

$fileList = new FileList;

$items = $fileList->get('/path/to/files');

// Use the items array
print '';
foreach ($items as $item) {
    if ($item[FileList::KEY_TYPE] == FileList::TYPE_DIR) {
        print 'd' . "\t" . $item[FileList::KEY_NAME] . PHP_EOL;
    } else {
        print 'f' . "\t" . $item[FileList::KEY_NAME] . "\t" . $item[FileList::KEY_SIZE] . "\t" . date('Y-m-d', $item[FileList::KEY_DATE]) . PHP_EOL;
    }
}
print '';
```

Or to get only directories:

```
$items = $fileList->get('/path/to/files', FileList::TYPE_DIR);
```

Or only files:

```
$items = $fileList->get('/path/to/files', FileList::TYPE_FILE);
```

Or only files of a certain extension:

```
$extensions = array('jpg', 'png', 'jpeg', 'gif');
$items      = $fileList->get('/path/to/files', FileList::TYPE_DIR, FileList::KEY_NAME, FileList::ASC, null, $extensions);
```

Order by the Size descending:

```
$items = $fileList->get('/path/to/files', FileList::TYPE_DIR, FileList::KEY_SIZE, FileList::DESC);
```

###  Health Score

29

—

LowBetter than 58% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Total

2

Last Release

3947d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac74f1d8680bf428354d9454f004220bbfffc3ff598333ff89777451887e9e12?d=identicon)[jc21](/maintainers/jc21)

---

Top Contributors

[![jc21](https://avatars.githubusercontent.com/u/1518257?v=4)](https://github.com/jc21 "jc21 (6 commits)")

---

Tags

filelistingdir

### Embed Badge

![Health badge](/badges/jc21-filelist/health.svg)

```
[![Health](https://phpackages.com/badges/jc21-filelist/health.svg)](https://phpackages.com/packages/jc21-filelist)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k665.7M2.4k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k277.8M952](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k40.9M129](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72429.6M99](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226254.9M71](/packages/league-flysystem-local)[adlawson/vfs

Virtual file system

300438.9k22](/packages/adlawson-vfs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
