PHPackages                             wherw/scan-path - 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. wherw/scan-path

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

wherw/scan-path
===============

Recursive directory scanner to search for files using the file extension or mime type

v1.0.4(5y ago)1144MITPHPPHP &gt;=7.1

Since Jun 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/aleksandrostapets/scan-path)[ Packagist](https://packagist.org/packages/wherw/scan-path)[ RSS](/packages/wherw-scan-path/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

SCAN PATH LIBRARY
-----------------

[](#scan-path-library)

The library is used to get a list of files in a given category. When you find subdirectories, a list of files is also extracted from it.

REQUIREMENTS
------------

[](#requirements)

The minimum requirement by this project template that your Web server supports PHP 7.1.0.

INSTALLATION
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).

```
composer require wherw/scan-path

```

CONFIGURATION
-------------

[](#configuration)

Create an instance of the ScanPath class

Create an instance of the ScanPath class. To search for files using this library, you need to call the setExtension method with a parameter in which you need to specify the array of file extensions you want to find. If you want to find files using mimeType, you need to call the setMimeType method, in which you need to specify the type of file you want to find. Supported types:

- application;
- audio;
- image;
- multipart;
- text;
- video;

But keep in mind that this method takes much longer than the setExtension method

EXAMPLE
-------

[](#example)

```
$scan = new \wherw\ScanPath();
$scan->setPath('/mnt/music/');
$scan->setExtension([
    'm4a',
    'flac',
    'ogg',
    'mp3',
    'wma',
    'wav',
    'ape',
    'aac'
]);

$files = $scan->getFiles();

```

```
$scan = new \wherw\ScanPath();
$scan->setPath('/mnt/music/');
$scan->setMimeType('audio');

$files = $scan->getFiles();

```

```
$scan = new \wherw\ScanPath();
$fileTypes = $scan->setPath('/mnt/')->getFileTypes();

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~24 days

Total

8

Last Release

1987d ago

Major Versions

v0.1.2 → v1.0.02020-08-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d4c86718dd3f6ae574516bae805bc9b8caff97a8a46f5bc3d29bde32f697b9b?d=identicon)[a.ostapets](/maintainers/a.ostapets)

---

Top Contributors

[![aleksandrostapets](https://avatars.githubusercontent.com/u/30779664?v=4)](https://github.com/aleksandrostapets "aleksandrostapets (23 commits)")

---

Tags

filesystem

### Embed Badge

![Health badge](/badges/wherw-scan-path/health.svg)

```
[![Health](https://phpackages.com/badges/wherw-scan-path/health.svg)](https://phpackages.com/packages/wherw-scan-path)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72528.6M91](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[oneup/flysystem-bundle

Integrates Flysystem filesystem abstraction library to your Symfony project.

64422.9M66](/packages/oneup-flysystem-bundle)

PHPackages © 2026

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