⌨️ Convert php .env environment variables in Heroku environment variables
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cli
example
src
.editorconfig
.env
.gitignore
LICENSE
README.md
composer.json
dotenv-heroku-converter

README.md

PHP Dotenv Heroku converter

Convert php .env variables to Heroku config variables.

Why creating this package?

I created this package because I often use a PHP project/framework that uses the vlucas/phpdotenv package to handle PHP environment values in a .env file.

You can't create/modify files on your Heroku server using Heroku CLI (ok, in fact you can), and you can't create your production .env file, so you have to manually create your environment variables using Heroku CLI or on your Heroku dashboard.

This PHP script can automatically convert the environement variables from a .env file in Heroku config variables.

Like that, you just have to define the values of your Heroku config variables for production.

Requirements

Heroku CLI

This PHP script uses Heroku CLI. You must have installed it on your machine.

Install

Install Composer and issue the following command:

$ composer global require cba85/dotenv-heroku-converter

Then make sure you have the global Composer binaries directory in your PATH.

This directory is platform-dependent, see Composer documentation for details.

Update

You can update this package through this command:

$ composer global update cba85/dotenv-heroku-converter

Usage

Go to your project folder that contains a .env file.

$ dotenv-heroku-converter