PHPackages                             webalternatif/flysystem-failover-bundle - 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. webalternatif/flysystem-failover-bundle

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

webalternatif/flysystem-failover-bundle
=======================================

A bundle to create failover Flysystem adapters.

v0.7.0(9mo ago)22.9k↓74%3MITPHPPHP 8.2.\* || 8.3.\* || 8.4.\*CI passing

Since Sep 10Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/webalternatif/flysystem-failover-bundle)[ Packagist](https://packagist.org/packages/webalternatif/flysystem-failover-bundle)[ RSS](/packages/webalternatif-flysystem-failover-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (17)Versions (17)Used By (3)

Flysystem failover bundle
=========================

[](#flysystem-failover-bundle)

[![Source code](https://camo.githubusercontent.com/9b8ddc7e56da16a99ff97b3a2bf8574dbb0d4ead97f47acc88d308eb47ef5730/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d4769744875622d626c7565)](https://github.com/webalternatif/flysystem-failover-bundle)[![Software license](https://camo.githubusercontent.com/23b8b712bd8efbacc4c2ad0e4099cbf9b362a3f23f891cf7041d91a00322a350/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f776562616c7465726e617469662f666c7973797374656d2d6661696c6f7665722d62756e646c65)](https://github.com/webalternatif/flysystem-failover-bundle/blob/main/LICENSE)[![GitHub issues](https://camo.githubusercontent.com/57500c7962b7f3cc6e49b8ecabeade121552179853314c939c62c85c2f156b6b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f776562616c7465726e617469662f666c7973797374656d2d6661696c6f7665722d62756e646c65)](https://github.com/webalternatif/flysystem-failover-bundle/issues)[![Test status](https://camo.githubusercontent.com/0efc17ac7db307ead1e3fc76fd1ea5c14fdf73b685b22342dde9c4abb16b3a31/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776562616c7465726e617469662f666c7973797374656d2d6661696c6f7665722d62756e646c652f746573742e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/webalternatif/flysystem-failover-bundle/actions/workflows/test.yml)[![Psalm coverage](https://camo.githubusercontent.com/88a7032f6588370651362a3976597a7946bf21a6b47e524a5af6d444e5914cd1/68747470733a2f2f73686570686572642e6465762f6769746875622f776562616c7465726e617469662f666c7973797374656d2d6661696c6f7665722d62756e646c652f636f7665726167652e737667)](https://psalm.dev)[![Psalm level](https://camo.githubusercontent.com/b5d62c179576c4d9ac27e3dfe2146e76f0edcd8f9360a2c0d4c5529031d9047c/68747470733a2f2f73686570686572642e6465762f6769746875622f776562616c7465726e617469662f666c7973797374656d2d6661696c6f7665722d62756e646c652f6c6576656c2e737667)](https://psalm.dev)[![Mutation testing badge](https://camo.githubusercontent.com/d640739a771e46b77d9991473048497e60c08cf83c39af5d54b2ecd66119c531/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246776562616c7465726e61746966253246666c7973797374656d2d6661696c6f7665722d62756e646c652532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/webalternatif/flysystem-failover-bundle/main)

This bundle allows creating failover [Flysystem](https://github.com/thephpleague/flysystem) adapters and provides tooling to keep underlying storages synchronized.

💡 Tip: you may want to use this bundle through [webalternatif/flysystem-dsn-bundle](https://github.com/webalternatif/flysystem-dsn-bundle), which makes the configuration [much easier](https://github.com/webalternatif/flysystem-dsn#failover).

How it works
------------

[](#how-it-works)

This bundle allows you to create failover adapters for Flysystem. A failover adapter is an adapter that is built upon multiple (already existing) adapters.

When you use a failover adapter, it will forward method calls to inner adapters.

- For reading, it will use the first that works.
- For writing, it will use the first that works and will push messages into a repository to keep underlying storages of all adapters synchronized.

Messages in the repository can then be asynchronously processed by a console command call (see [Processing messages](#processing-messages) section).

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require webalternatif/flysystem-failover-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require webalternatif/flysystem-failover-bundle
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Webf\FlysystemFailoverBundle\WebfFlysystemFailoverBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

Failover adapters are configured under the `webf_flysystem_failover.adapters`Symfony config path, and are then available as services with id `webf_flysystem_failover.adapter.{name}`.

Each failover adapter must have at least 2 inner adapters. An inner adapter could be a string to reference a service id, or an array with the following attributes:

- `service_id`: *(required)* identifier of the inner adapter service,
- `time_shift`: a time shift for when the synchronization command compares modification dates between inner adapters.

Message repository is customizable under the `webf_flysystem_failover.message_repository_dsn` Symfony config path. For now, only `doctrine://` and `service://` are available.

```
webf_flysystem_failover:
    adapters:
        adapter1: # service: webf_flysystem_failover.adapter.adapter1
            adapters:
                - service_id_of_adapter_1
                - service_id: service_id_of_adapter_2
                  time_shift: 7200 # underlying storage of this adapter use a +02:00 timezone

        adapter2: # service: webf_flysystem_failover.adapter.adapter2
            adapters:
                - service_id_of_adapter_3
                - service_id_of_adapter_4
                - service_id_of_adapter_5

    message_repository_dsn: doctrine://my_connection
```

Run `bin/console config:dump-reference webf_flysystem_failover` for more info.

### Processing messages

[](#processing-messages)

To process messages created by failover adapters, the following command is available:

```
$ bin/console webf:flysystem-failover:process-messages
```

It will process and remove the oldest messages present in the repository.

### Listing messages to be processed

[](#listing-messages-to-be-processed)

To list messages without removing them from the repository, run the following command:

```
$ bin/console webf:flysystem-failover:list-messages
```

Results are paginated by default, you can use `--limit` (`-l`) and `--page`(`-p`) to configure pagination.

If [`symfony/serializer`](https://github.com/symfony/serializer) is installed, the `--format` (`-f`) becomes available and allows you to display output in `csv`, `json` or `xml`.

Use `--help` for more info.

### Synchronize existing storages

[](#synchronize-existing-storages)

If you start to use this bundle on an existing project, you may want to manually synchronize an existing non-empty storage with other new empty ones.

It is possible with the following command:

```
$ bin/console webf:flysystem-failover:sync
```

Use `--help` for more info.

Tests
-----

[](#tests)

To run all tests, execute the command:

```
$ composer test
```

This will run [Psalm](https://psalm.dev), [PHPUnit](https://phpunit.de), [Infection](https://infection.github.io) and a [PHP-CS-Fixer](https://cs.symfony.com/)check, but you can run them individually like this:

```
$ composer psalm
$ composer phpunit
$ composer infection
$ composer cs-check
```

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance56

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

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

Every ~97 days

Recently: every ~55 days

Total

16

Last Release

290d ago

PHP version history (6 changes)v0.1.0PHP 8.0.\*

v0.3.2PHP 8.0.\* || 8.1.\*

v0.4.2PHP 8.0.\* || 8.1.\* || 8.2.\*

v0.4.3PHP 8.0.\* || 8.1.\* || 8.2.\* || 8.3.\*

v0.5.0PHP 8.2.\* || 8.3.\*

v0.5.1PHP 8.2.\* || 8.3.\* || 8.4.\*

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

filesystembundleFlysystemadapterstoragefailover

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/webalternatif-flysystem-failover-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webalternatif-flysystem-failover-bundle/health.svg)](https://phpackages.com/packages/webalternatif-flysystem-failover-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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