2017 © Pedro Peláez
 

library api-platform-heroku

Helpers to use API Platform and Symfony applications on Heroku.

image

dunglas/api-platform-heroku

Helpers to use API Platform and Symfony applications on Heroku.

  • Saturday, July 4, 2015
  • by dunglas
  • Repository
  • 1 Watchers
  • 3 Stars
  • 3,515 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 10 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

API Platform and Symfony helpers to deploy on Heroku

This library eases the deployment of API Platform and Symfony applications on the Heroku platform., (*1)

Build Status Scrutinizer Code Quality SensioLabsInsight Dependency Status, (*2)

Install

Use Composer to install the library in your project:, (*3)

composer require dunglas/api-platform-heroku, (*4)

Database helper

The library provides a Composer script to create Symfony parameters for the Doctrine bundle by parsing the DATABASE_URL environment variable populated by the Heroku Postgres addon., (*5)

To use it, start by adding the script to your composer.json file:, (*6)

// ...
    "scripts": {
        "pre-install-cmd": [
          "Dunglas\\Heroku\\Database::createParameters"
        ],
        // ...
    }

Thanks to the ability of the Symfony Dependency Injection Component to read parameters from special environment variables, the parameters are automatically populated., (*7)

Change the content of the app/config/services.yml like the following to use them:, (*8)

doctrine:
    dbal:
        driver:   "pdo_pgsql"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8

In your local development environment, don't forget to set the SYMFONY__DATABASE_URL environment variable. A typical value for that variable is `postgres://user:pass@server:5432/dbname., (*9)

A convenient way to manage environment variable is the PHP dotenv library., (*10)

Credits

This library is part of the API Platform project. Created by Kévin Dunglas., (*11)

The Versions

04/07 2015

dev-master

9999999-dev http://api-platform.com

Helpers to use API Platform and Symfony applications on Heroku.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

symfony api platform heroku