PHPackages                             olegpopadko/composer-heroku-database-environment - 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. [Database &amp; ORM](/categories/database)
4. /
5. olegpopadko/composer-heroku-database-environment

ActiveLibrary[Database &amp; ORM](/categories/database)

olegpopadko/composer-heroku-database-environment
================================================

Simple connect to herokupostgres for php-applications

033PHP

Since Oct 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/olegpopadko/heroku-php-database-environment)[ Packagist](https://packagist.org/packages/olegpopadko/composer-heroku-database-environment)[ RSS](/packages/olegpopadko-composer-heroku-database-environment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

heroku-php-database-environment
===============================

[](#heroku-php-database-environment)

Simple connect to [herokupostgres](https://www.heroku.com/postgres) for php-applications

\##Usage

Add the following in your root composer.json file:

```
{
    "require": {
        "olegpopadko/composer-heroku-database-environment": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "OlegPopadko\\HerokuDatabaseEnvironment\\Composer\\EnvironmentHandler::expand"
        ]
    }
}
```

`EnvironmentHandler` divides `DATABASE_URL` environment variable and expands your environment with new five variables.

After `composer install` you will have something like this in your environment

```
DATABASE_URL=postgres://user:password@database.host:5432/database_name

DATABASE_HOST=database.host
DATABASE_PORT=5432
DATABASE_USER=user
DATABASE_PASSWORD=password
DATABASE_NAME=database_name
```

Now you can easily setup your app with Heroku database credentials.

\##Addition setup for [incenteev/composer-parameter-handler](https://github.com/Incenteev/ParameterHandler)

You can setup it in `composer.json` like this:

```
{
  "scripts": {
      "post-install-cmd": [
          "OlegPopadko\\HerokuDatabaseEnvironment\\Composer\\EnvironmentHandler::expand",
          "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
      ]
  },
  "extra": {
        "incenteev-parameters": {
            "file": "app/config/parameters.yml",
            "env-map": {
                "database_host": "DATABASE_HOST",
                "database_port": "DATABASE_PORT",
                "database_name": "DATABASE_NAME",
                "database_user": "DATABASE_USER",
                "database_password": "DATABASE_PASSWORD"
            }
        }
    }
}
```

**Note:** `EnvironmentHandler::expand` must be executed before `ScriptHandler::buildParameters`.

It's would be usefull if you are using [Symfony](https://symfony.com/).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/olegpopadko-composer-heroku-database-environment/health.svg)

```
[![Health](https://phpackages.com/badges/olegpopadko-composer-heroku-database-environment/health.svg)](https://phpackages.com/packages/olegpopadko-composer-heroku-database-environment)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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