PHPackages                             platformsh/symfonyflex-bridge - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. platformsh/symfonyflex-bridge

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

platformsh/symfonyflex-bridge
=============================

Bridge library for running Symfony Flex on Platform.sh

2.7.2(3y ago)291.5M↓14.2%15[1 issues](https://github.com/platformsh/symfonyflex-bridge/issues)[1 PRs](https://github.com/platformsh/symfonyflex-bridge/pulls)9MITPHPPHP &gt;=7.2

Since Jan 25Pushed 3y ago14 watchersCompare

[ Source](https://github.com/platformsh/symfonyflex-bridge)[ Packagist](https://packagist.org/packages/platformsh/symfonyflex-bridge)[ RSS](/packages/platformsh-symfonyflex-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (18)Used By (9)

> **Archived library:** The Symfony Flex Bridge has been archived and is no longer the recommended tool for deployment on Platform.sh. Users should consult the new and official [Platform.sh template provided from Symfony](https://github.com/symfonycorp/platformsh-symfony-template) and its use of the [Symfony configurator script](https://symfony.com/doc/current/cloud/config.html).

Symfony Flex bridge for Platform.sh
===================================

[](#symfony-flex-bridge-for-platformsh)

This simple bridge library connects a Symfony Flex-based application to [Platform.sh](https://platform.sh/). In the typical case it should be completely fire-and-forget.

Symfony Flex expects all configuration to come in through environment variables with specific names in a specific format. Platform.sh provides configuration information as environment variables in a different specific format. This library handles mapping the Platform.sh variables to the format Symfony Flex expects for common values.

Usage
-----

[](#usage)

Simply require this package using Composer. When Composer's autoload is included this library will be activated and the environment variables set. As long as that happens before Symfony bootstraps its configuration (which it almost certainly will) everything should work fine with no further user-interaction necessary.

```
composer require platformsh/symfonyflex-bridge

```

Mappings performed
------------------

[](#mappings-performed)

- If a Platform.sh relationship named `database` is defined, it will be taken as an SQL database and mapped to the `DATABASE_URL` environment variable for Symfony Flex. (Note: Due to a bug in Doctrine, the code currently assumes MariaDB 10.2 as the service version. If that Doctrine bug is ever resolved this hard-coding can be removed.)
- The Symfony Flex `APP_SECRET` is set based on the `PLATFORM_PROJECT_ENTROPY` variable, which is provided for exactly this purpose.
- The `MAILER_URL` variable is set based on the `PLATFORM_SMTP_HOST` variable. That will be used by SwiftMailer if it is installed. If not installed this value will be safely ignored.
- If no `APP_ENV` value is set, it will default to `prod`.

Elasticsearch
-------------

[](#elasticsearch)

If a Platform.sh relationship named `elasticsearch` is defined, it will be taken as an Elasticsearch index and mapped to appropriate environment variables. Most Elasticsearch packages for Symfony do not have a standard naming convention for environment variables so you will need to modify your Symfony configuration to read them.

For the common Elastica library, you would add the following to your Symfony `config/services.yaml` file:

```
# config/services.yaml
parameters:
  es_host: '%env(ELASTICSEARCH_HOST)%'
  es_port: '%env(ELASTICSEARCH_PORT)%'
```

And then you can reference those parameters in your Elastica configuration file:

```
# config/packages/fos_elastica.yaml
fos_elastica:
    clients:
        default: { host: '%es_host%', port: '%es_port%' }
```

MongoDB
-------

[](#mongodb)

If a Platform.sh relationship named `mongodatabase` is defined, it will be taken as a Doctrine ODM database and mapped to the appropriate environment variables. Note that you may still need to reference those environment variables in your configuration if they are not defined by default. See the [DoctrineMongoDBBundle](https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/index.html) documentation for more details.

Generally, placing the following in your `doctrine_mongodb.yaml` file should be sufficient:

```
# config/packages/doctrine_mongodb.yaml
doctrine_mongodb:
    connections:
        default:
            server: '%env(MONGODB_SERVER)%'
            options: { username: '%env(MONGODB_USERNAME)%', password: '%env(MONGODB_PASSWORD)%', authSource: '%env(MONGODB_DB)%' }
    default_database: '%env(MONGODB_DB)%'
```

RabbitMQ
--------

[](#rabbitmq)

If a Platform.sh relationship named `rabbitmqqueue` is defined, it will be taken as a RabbitMQ messenger backend and mapped to the appropriate environment variable.

Solr
----

[](#solr)

If a Platform.sh relationship named `solr` is defined, it will be taken as a Solr index and mapped to appropriate environment variables.

For the common uses, you would add the following to your Symfony `config/services.yaml` file:

```
# config/services.yaml
parameters:
    solr_dsn: '%env(SOLR_DSN)%'
    solr_core: '%env(SOLR_CORE)%'
```

And then you can reference those parameters in your configuration file:

```
# config/packages/search_engine_solr.yaml
search_engine_solr:
    endpoints:
        endpoint0:
            dsn: '%solr_dsn%'
            core: '%solr_core%'
    connections:
        default:
            entry_endpoints:
                - endpoint0
```

Redis Cache
-----------

[](#redis-cache)

If a Platform.sh relationship named `rediscache` is defined, it will be taken as a the storage engine for a cache pool.

For typical use you will need to define a file looking like this:

```
# config/packages/framework.yaml
framework:
    cache:
        app: cache.adapter.redis
        system: cache.adapter.redis
        default_redis_provider: "%env(CACHE_URL)%"
```

For more details see [here](https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html)

Redis session storage
---------------------

[](#redis-session-storage)

If a Platform.sh relationship named `redissession` is defined, it will be taken as a the storage engine for symfony session.

For typical use you will need to add a couple of service definitions which looks like this:

```
# config/packages/framework.yaml
framework:
    session:
        handler_id: '%env(SESSION_REDIS_URL)%'
```

For more details see [here](https://symfony.com/doc/current/session/database.html#store-sessions-in-a-key-value-database-redis)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 67.6% 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 ~107 days

Recently: every ~160 days

Total

17

Last Release

1312d ago

Major Versions

1.5.0 → 2.0.02019-03-22

PHP version history (2 changes)1.4.0PHP ^7.1

2.4.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ae5aac9c9f6b33d57fb70c593808445da3aefe9cc3a250641073a199810414c?d=identicon)[gilzow](/maintainers/gilzow)

![](https://www.gravatar.com/avatar/b4518010a3eb800a5ede865b20b64814514fa28d80cd35f42215d4dc3c99c593?d=identicon)[platformsh-devrel](/maintainers/platformsh-devrel)

---

Top Contributors

[![Crell](https://avatars.githubusercontent.com/u/254863?v=4)](https://github.com/Crell "Crell (73 commits)")[![chadwcarlson](https://avatars.githubusercontent.com/u/5473659?v=4)](https://github.com/chadwcarlson "chadwcarlson (13 commits)")[![tristanbes](https://avatars.githubusercontent.com/u/346010?v=4)](https://github.com/tristanbes "tristanbes (3 commits)")[![SerheyDolgushev](https://avatars.githubusercontent.com/u/166894?v=4)](https://github.com/SerheyDolgushev "SerheyDolgushev (3 commits)")[![flovntp](https://avatars.githubusercontent.com/u/1842696?v=4)](https://github.com/flovntp "flovntp (2 commits)")[![andrerom](https://avatars.githubusercontent.com/u/289757?v=4)](https://github.com/andrerom "andrerom (2 commits)")[![shyim](https://avatars.githubusercontent.com/u/6224096?v=4)](https://github.com/shyim "shyim (2 commits)")[![Aricura](https://avatars.githubusercontent.com/u/7595116?v=4)](https://github.com/Aricura "Aricura (2 commits)")[![jief](https://avatars.githubusercontent.com/u/740893?v=4)](https://github.com/jief "jief (1 commits)")[![damz](https://avatars.githubusercontent.com/u/110678?v=4)](https://github.com/damz "damz (1 commits)")[![dunglas](https://avatars.githubusercontent.com/u/57224?v=4)](https://github.com/dunglas "dunglas (1 commits)")[![ajardin](https://avatars.githubusercontent.com/u/3305232?v=4)](https://github.com/ajardin "ajardin (1 commits)")[![matthiaz](https://avatars.githubusercontent.com/u/3532563?v=4)](https://github.com/matthiaz "matthiaz (1 commits)")[![Plopix](https://avatars.githubusercontent.com/u/313532?v=4)](https://github.com/Plopix "Plopix (1 commits)")[![QuingKhaos](https://avatars.githubusercontent.com/u/993350?v=4)](https://github.com/QuingKhaos "QuingKhaos (1 commits)")[![ralt](https://avatars.githubusercontent.com/u/1016379?v=4)](https://github.com/ralt "ralt (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/platformsh-symfonyflex-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/platformsh-symfonyflex-bridge/health.svg)](https://phpackages.com/packages/platformsh-symfonyflex-bridge)
```

###  Alternatives

[symfony/service-contracts

Generic abstractions related to writing services

2.6k860.1M360](/packages/symfony-service-contracts)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)[friendsofphp/proxy-manager-lts

Adding support for a wider range of PHP versions to ocramius/proxy-manager

1.2k139.1M104](/packages/friendsofphp-proxy-manager-lts)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19013.0M263](/packages/php-stubs-wordpress-stubs)[infection/extension-installer

Infection Extension Installer

2624.2M16](/packages/infection-extension-installer)

PHPackages © 2026

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