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.

Installs: 650

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/afischoff/ruby-env-to-php

1.4 2016-01-15 03:04 UTC

This package is not auto-updated.

Last update: 2025-10-07 09:31:42 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');