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
Requires
- php: >=4.1.0
This package is not auto-updated.
Last update: 2024-11-05 04:52:05 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');