PHPackages                             thadbryson/flysystem-fallback - 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. thadbryson/flysystem-fallback

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

thadbryson/flysystem-fallback
=============================

Flysystem plugin use fallback Filesystems (ex: view themes).

v1.0.0(9y ago)032PHP

Since Mar 24Pushed 9y ago1 watchersCompare

[ Source](https://github.com/thadbryson/flysystem-fallback)[ Packagist](https://packagist.org/packages/thadbryson/flysystem-fallback)[ RSS](/packages/thadbryson-flysystem-fallback/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Flysystem Fallback Plugin
=========================

[](#flysystem-fallback-plugin)

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

[](#installation)

Use Composer:

```
"thadbryson/flysystem-fallback": "@stable"

```

This is a plugin for the Flysystem project.

It allows you to create a Filesystem hierarchy. If a **path** isn't in one Filesystem it will go to the next one until it finds it. Or runs out of Filesystems.

Here is some example code to set everything up.

### Primary

[](#primary)

The `$primary` Filesystem is the main one. It gets checked **1st**.

### Fallbacks

[](#fallbacks)

The `$fallback` Filesystems are ones checked after $primary. They go in order in their array.

### Example

[](#example)

```
use TCB\Flysystem\Fallback;
use TCB\Flysystem\FallbackPlugin;

use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local as Adapter;

// So client #1 has their own theme.
$primary = new Filesystem(new Adapter('~/themes/client-1'));

// Let's set the fallbacks in order.
$fallbacks = [
    '1'       => new Filesystem(new Adapter('~/themes/red')),
    'default' => new Filesystem(new Adapter('~/themes/default')),
];

// Add the Plugin.
$primary->addPlugin(new FallbackPlugin());

// You can get the Fallback object from the 'getFallback()' plugin method.
$fallback = $primary->getFallback($fallbacks);

// OR - you can just create the Fallback object directly.
$fallback = new Fallback($primary, $fallbacks);
```

### Methods you can call

[](#methods-you-can-call)

These `Filesystem` methods are available on Fallback. The first Filesystem with the path found will return the result from that Filesystem or "hit".

NOTE: all these methods return `FALSE` if $path is not found.

- has(string $path): Do any of these Filesystems have this path?
- read(string $path): Read file contents from first "hit".
- readStream(string $path): Read a stream of the file contents from first "hit".

Other methods available:

- find(string $path): Returns the Filesystem object of the first hit.
- findIndex(string $path): Returns index string/int of Filesystem with $path. Will return FALSE if not found.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Unknown

Total

1

Last Release

3384d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/222212?v=4)[Thad Bryson](/maintainers/thadbryson)[@thadbryson](https://github.com/thadbryson)

---

Top Contributors

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

---

Tags

filesystemflysystemflysystem-pluginphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thadbryson-flysystem-fallback/health.svg)

```
[![Health](https://phpackages.com/badges/thadbryson-flysystem-fallback/health.svg)](https://phpackages.com/packages/thadbryson-flysystem-fallback)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k277.8M965](/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.1k3.4M81](/packages/unisharp-laravel-filemanager)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40331.4M120](/packages/league-flysystem-bundle)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[alexusmai/laravel-file-manager

File manager for Laravel

1.2k786.7k9](/packages/alexusmai-laravel-file-manager)[barryvdh/elfinder-flysystem-driver

A Flysystem Driver for elFinder

1864.9M40](/packages/barryvdh-elfinder-flysystem-driver)

PHPackages © 2026

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