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

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

webalternatif/flysystem-dsn-bundle
==================================

A bundle to build Flysystem adapters from DSN (Data Source Name).

v0.8.0(8mo ago)32.6k↓33.3%1MITPHPPHP 8.2.\* || 8.3.\* || 8.4.\*CI passing

Since Aug 31Pushed 8mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (16)Versions (17)Used By (0)

Flysystem DSN bundle
====================

[](#flysystem-dsn-bundle)

[![Source code](https://camo.githubusercontent.com/9b8ddc7e56da16a99ff97b3a2bf8574dbb0d4ead97f47acc88d308eb47ef5730/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d4769744875622d626c7565)](https://github.com/webalternatif/flysystem-dsn-bundle)[![Packagist Version](https://camo.githubusercontent.com/219fe271d6db7ab8d30b3a0ac24128b1f5156bae98675d55058dca7371be94a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c65)](https://packagist.org/packages/webalternatif/flysystem-dsn-bundle)[![Software license](https://camo.githubusercontent.com/965a286f3627a9c04037b7417ae4f7991067f99f21f76e45af739fe0dfab23e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c65)](https://github.com/webalternatif/flysystem-dsn-bundle/blob/main/LICENSE)[![GitHub issues](https://camo.githubusercontent.com/e8e8d04625bb446c481ae6fb7509283d9ce9bad9852b92f11d9d5069561ed8e9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c65)](https://github.com/webalternatif/flysystem-dsn-bundle/issues)
[![Test status](https://camo.githubusercontent.com/3d5a67009cc2eef129e65b75c598fcc640086843d2227e54cfebfacf1f57cda2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c652f746573742e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/webalternatif/flysystem-dsn-bundle/actions/workflows/test.yml)[![Psalm coverage](https://camo.githubusercontent.com/f5e61e6ccd122736c1711fcdbe93b30399ba8553340c8f4b8efd1b580a4f9a12/68747470733a2f2f73686570686572642e6465762f6769746875622f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c652f636f7665726167652e737667)](https://psalm.dev)[![Psalm level](https://camo.githubusercontent.com/5f98d402143e35efb62478a7aa049f3ae671ee396af3cbb25faee5f31827027a/68747470733a2f2f73686570686572642e6465762f6769746875622f776562616c7465726e617469662f666c7973797374656d2d64736e2d62756e646c652f6c6576656c2e737667)](https://psalm.dev)[![Mutation testing badge](https://camo.githubusercontent.com/9d53b1a26f3da65e09e6ae82b78238c0244d6417dfdf63c419d41afce9d6c408/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246776562616c7465726e61746966253246666c7973797374656d2d64736e2d62756e646c652532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/webalternatif/flysystem-dsn-bundle/main)

This bundle integrates the [Flysystem DSN](https://github.com/webalternatif/flysystem-dsn) library with Symfony, allowing the creation of adapters as services with DSN from the configuration.

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-dsn-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-dsn-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\Flysystem\DsnBundle\WebfFlysystemDsnBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

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

```
webf_flysystem_dsn:
    adapters:
        adapter1: '%env(STORAGE1_DSN)%' # service: webf_flysystem_dsn.adapter.adapter1
        adapter2: '%env(STORAGE2_DSN)%' # service: webf_flysystem_dsn.adapter.adapter2
```

In addition to [available adapters](https://github.com/webalternatif/flysystem-dsn#adapters) from `webalternatif/flysystem-dsn`, this bundle provides a Symfony-specific DSN `service://service_id` to which you must provide an identifier that references an external service (that must be a Flysystem adapter). It could be useful if you already have adapter services, and you want to inject them into a composed adapter like `failover`: `failover(service://external_service_id ...)`.

### Integration with Flysystem bundles

[](#integration-with-flysystem-bundles)

As explained above, this bundle only provides services that are Flysystem adapters, but they're not usable as is. Generally you'll have to use another bundle that provide `FilesystemOperator` instances.

The two best known are [`oneup/flysystem-bundle`](https://github.com/1up-lab/OneupFlysystemBundle) and [`league/flysystem-bundle`](https://github.com/thephpleague/flysystem-bundle), here is some examples of configuration for those two bundles (considering the `webf_flysystem_dsn` configuration above).

#### `oneup/flysystem-bundle`

[](#oneupflysystem-bundle)

```
oneup_flysystem:
    adapters:
        adapter1:
            custom:
                service: webf_flysystem_dsn.adapter.adapter1
        adapter2:
            custom:
                service: webf_flysystem_dsn.adapter.adapter2

    filesystems:
        storage1:
            adapter: adapter1
        storage2:
            adapter: adapter2
```

#### `league/flysystem-bundle`

[](#leagueflysystem-bundle)

```
flysystem:
    storages:
        storage1:
            adapter: webf_flysystem_dsn.adapter.adapter1
        storage2:
            adapter: webf_flysystem_dsn.adapter.adapter2
```

### Integration with [`webalternatif/flysystem-failover-bundle`](https://github.com/webalternatif/flysystem-failover-bundle)

[](#integration-with-webalternatifflysystem-failover-bundle)

If [`webalternatif/flysystem-failover-bundle`](https://github.com/webalternatif/flysystem-failover-bundle) is installed, the [`failover`](https://github.com/webalternatif/flysystem-dsn#failover) DSN function becomes available and all configured failover adapters are registered so that they can be used in `webf:flysystem-failover:*`Symfony commands.

#### Using `failover` DSN function nested in others

[](#using-failover-dsn-function-nested-in-others)

In order to use the `failover` DSN function as parameter of other DSN functions, adapters created by the corresponding factories must implement `CompositeFilesystemAdapter` from [`webalternatif/flysystem-composite`](https://github.com/webalternatif/flysystem-composite). Without that, the bundle wouldn't be able to register them, and they won't be usable in `webf:flysystem-failover:*` Symfony commands.

### Using your own DSN

[](#using-your-own-dsn)

If you want to use your own DSN to build your own Flysystem adapters, you can create an adapter factory service that implement `Webf\Flysystem\Dsn\FlysystemAdapterFactoryInterface`.

To register the factory, either you have [autoconfiguration](https://symfony.com/doc/current/service_container.html#the-autoconfigure-option) enabled, or you have to tag your service with `webf_flysystem_dsn.adapter_factory` (also available in PHP with `Webf\Flysystem\DsnBundle\DependencyInjection\WebfFlysystemDsnExtension::ADAPTER_FACTORY_TAG_NAME`).

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

44

—

FairBetter than 92% of packages

Maintenance61

Regular maintenance activity

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 96.8% 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 ~98 days

Recently: every ~226 days

Total

16

Last Release

243d ago

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

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

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

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

v0.6.0PHP 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 (61 commits)")[![LegendPJ](https://avatars.githubusercontent.com/u/1092440?v=4)](https://github.com/LegendPJ "LegendPJ (1 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (1 commits)")

---

Tags

filesystembundleFlysystemadapterstoragedsn

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40129.5M87](/packages/league-flysystem-bundle)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

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

Integrates Flysystem filesystem abstraction library to your Symfony project.

64422.9M66](/packages/oneup-flysystem-bundle)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

2610.5M31](/packages/league-flysystem-async-aws-s3)[nimbusoft/flysystem-openstack-swift

Flysystem adapter for OpenStack Swift

44774.4k6](/packages/nimbusoft-flysystem-openstack-swift)

PHPackages © 2026

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