PHPackages                             phpdocumentor/flyfinder - 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. phpdocumentor/flyfinder

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

phpdocumentor/flyfinder
=======================

Flysystem plugin to add file finding capabilities to the Filesystem entity

2.0.0(1y ago)30634.1k—1.2%7[3 PRs](https://github.com/phpDocumentor/flyfinder/pulls)4MITPHPPHP ^8.0||^8.1||^8.2||^8.3CI passing

Since Aug 18Pushed 1w ago2 watchersCompare

[ Source](https://github.com/phpDocumentor/flyfinder)[ Packagist](https://packagist.org/packages/phpdocumentor/flyfinder)[ Docs](http://www.phpdoc.org)[ RSS](/packages/phpdocumentor-flyfinder/feed)WikiDiscussions 2.x Synced 2d ago

READMEChangelog (8)Dependencies (8)Versions (18)Used By (4)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/befad4ca110e135f61796b9f11dcb879985800056bccc530a8d57fe5baf36798/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f706870446f63756d656e746f722f466c7946696e6465722e737667)](https://scrutinizer-ci.com/g/phpDocumentor/FlyFinder/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d241a6b6f363b8e312f266ae81551f81032bfaf960e44ebf950c1d0d55e88a2e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706870446f63756d656e746f722f466c7946696e6465722e737667)](https://scrutinizer-ci.com/g/phpDocumentor/FlyFinder/?branch=master)[![Stable Version](https://camo.githubusercontent.com/5eb647f79242aee065bb282b96321e864d1abe8ae5c23d81f2b7d1e1348681e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870446f63756d656e746f722f466c7946696e6465722e737667)](https://packagist.org/packages/phpDocumentor/FlyFinder)[![Unstable Version](https://camo.githubusercontent.com/72ab4b6a695cb8d911c62e5a01c2734dbda90664dc47652b81f89cde98bb9baf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f706870446f63756d656e746f722f466c7946696e6465722e737667)](https://packagist.org/packages/phpDocumentor/FlyFinder)

FlyFinder
=========

[](#flyfinder)

FlyFinder is a utility class for [Flysystem](http://flysystem.thephpleague.com/) that will enable you to find files based on certain criteria.

FlyFinder can search for files that are hidden (either because they are hidden files themselves, or because they are inside a hidden directory), that have a certain extension, or that exist in a certain path.

Flyfinder does *not* return directories themselves... only files.

Installation
------------

[](#installation)

The easiest way to install this library is with [Composer](https://getcomposer.org) using the following command:

```
$ composer require phpdocumentor/flyfinder

```

Examples
--------

[](#examples)

Ready to dive in and don't want to read through all that text below? Just consult the [examples](examples) folder and check which type of action that your want to accomplish.

Usage
-----

[](#usage)

In order to use the FlyFinder plugin you first need a Flyfinder filesystem with an adapter, for instance the local adapter.

```
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter;
use Flyfinder\Finder;

$filesystem = new Filesystem(new LocalAdapter(__DIR__.'/path/to/files/'));

```

Now you can create the `Finder` instance:

```
$finder = new Finder($filesystem);

```

FlyFinder will need specifications to know what to look for. The following specifications are available:

- IsHidden (this specification will return `true` when a file or directory is hidden,
- HasExtension (this specification will return `true` when a file or directory has the specified extension),
- InPath (this specification will return `true` when a file is in the given path. Wildcards are allowed.)
    - note that this path should be considered relative to the `$filesystem`'s path

Specifications can be instantiated as follows:

```
use Flyfinder\Path;
use Flyfinder\Specification\IsHidden;
use Flyfinder\Specification\HasExtension;
use Flyfinder\Specification\InPath;

$isHidden = new IsHidden();
$hasExtension = new HasExtension(['txt']);
$inPath = new InPath(new Path('mydir'));

```

### Combining specifications

[](#combining-specifications)

You can search on more criteria by combining the specifications. Specifications can be chained as follows:

`$isHidden->andSpecification($hasExtension)` will find all files and directories that are hidden AND have the given extension.

`$isHidden->orSpecification($hasExtension)` will find all files and directories that are hidden OR have the given extension.

`$isHidden->notSpecification` will find all files and directories that are NOT hidden.

You can also make longer chains like this:

`$specification = $inPath->andSpecification($hasExtension)->andSpecification($isHidden->notSpecification());`

This will find all files in the given path, that have the given extension and are not hidden.

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance70

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~584 days

Total

9

Last Release

49d ago

Major Versions

1.1.0 → 2.0.02024-09-15

PHP version history (5 changes)1.0.0-alpha1PHP &gt;=5.5

1.0.0-beta2PHP &gt;=7.1

1.0.0-beta4PHP ^7.2

1.1.0PHP ^7.2||^8.0

2.0.0PHP ^8.0||^8.1||^8.2||^8.3

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/471baf346b526fa9e1259ee3d577b1dd72fbb45337b495d5475f87ba063490cb?d=identicon)[jaapio](/maintainers/jaapio)

---

Top Contributors

[![ashnazg](https://avatars.githubusercontent.com/u/100170?v=4)](https://github.com/ashnazg "ashnazg (84 commits)")[![jaapio](https://avatars.githubusercontent.com/u/1060433?v=4)](https://github.com/jaapio "jaapio (40 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![mbed67](https://avatars.githubusercontent.com/u/7139949?v=4)](https://github.com/mbed67 "mbed67 (8 commits)")[![mvriel](https://avatars.githubusercontent.com/u/193704?v=4)](https://github.com/mvriel "mvriel (5 commits)")[![villfa](https://avatars.githubusercontent.com/u/2891564?v=4)](https://github.com/villfa "villfa (4 commits)")[![jnkowa-gfk](https://avatars.githubusercontent.com/u/16591768?v=4)](https://github.com/jnkowa-gfk "jnkowa-gfk (2 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![rulatir](https://avatars.githubusercontent.com/u/677694?v=4)](https://github.com/rulatir "rulatir (2 commits)")[![douglasmiller](https://avatars.githubusercontent.com/u/1467444?v=4)](https://github.com/douglasmiller "douglasmiller (1 commits)")

---

Tags

Flysystemphpdoc

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpdocumentor-flyfinder/health.svg)

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M85](/packages/unisharp-laravel-filemanager)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40432.5M136](/packages/league-flysystem-bundle)[barryvdh/elfinder-flysystem-driver

A Flysystem Driver for elFinder

1865.1M41](/packages/barryvdh-elfinder-flysystem-driver)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2682.2M18](/packages/masbug-flysystem-google-drive-ext)

PHPackages © 2026

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