定制 dunglas/api-platform-heroku 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dunglas/api-platform-heroku

Composer 安装命令:

composer require dunglas/api-platform-heroku

包简介

Helpers to use API Platform and Symfony applications on Heroku.

README 文档

README

This library eases the deployment of API Platform and Symfony applications on the Heroku platform.

Build Status Scrutinizer Code Quality SensioLabsInsight Dependency Status

Install

Use Composer to install the library in your project:

composer require dunglas/api-platform-heroku

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.

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

// ...
    "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.

Change the content of the app/config/services.yml like the following to use them:

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.

A convenient way to manage environment variable is the PHP dotenv library.

Credits

This library is part of the API Platform project. Created by Kévin Dunglas.

统计信息

  • 总下载量: 3.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固