afischoff/ruby-env-to-php

Allows a PHP codebase to use an existing Ruby ".env" configuration file. This allows both codebases to share the same configuration.

1.4 2016-01-15 03:04 UTC

This package is not auto-updated.

Last update: 2024-04-23 02:05:57 UTC


README

Allows a PHP codebase to use an existing Ruby ".env" configuration file. This allows both codebases to share the same configuration.

Usage:

<?php
use Afischoff\RubyEnvToPhp;

require ('src/Afischoff/RubyEnvToPhp.php');

// load Ruby .env file
RubyEnvToPhp::load('../path/to/ruby/codebase/.envFile');

// convert DB connection string to Laravel/Lumen DB environment variables
RubyEnvToPhp::splitDbStringToVars($_ENV['DATABASE_URL'], 'mysql');

Adding to Laravel / Lumen: Toward the top of "bootstrap/app.php":

\Afischoff::RubyEnvToPhp::load('../path/to/ruby/codebase/.envFile');