2017 © Pedro Peláez
 

library phpenv

Easy to load system enivronment configuration from $_ENV,$_SERVER,getenv.

image

zrcing/phpenv

Easy to load system enivronment configuration from $_ENV,$_SERVER,getenv.

  • Thursday, May 18, 2017
  • by liaogling
  • Repository
  • 2 Watchers
  • 12 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

PHP Env

Easy to load system enivronment configuration from $_ENV,$_SERVER,getenv., (*1)

Installation

Insstall the lastest version with, (*2)

$ composer require zrcing/phpenv

or, (*3)

{
    "name" : "project name",
    "repositories" : [ {
        "type" : "composer",
        "url" : "https://packagist.org/"
    }],
    "require": {
        "zrcing/phpenv": "~1.0"
    }
}

Demo

Step 1: Created .env file

#Master database
DB_HOST = '127.0.0.1' #Local database
DB_NAME="db_name"
DB_USER="root"
DB_PWD="root"
DB_PORT=3306

#Slave database 1
DB_SLAVE1_HOST="127.0.0.1"
DB_SLAVE1_NAME="db_name"
DB_SLAVE1_USER="root"
DB_SLAVE1_PWD="root"
DB_SLAVE1_PORT=3306

Step 2: Usage

use Phpenv\Env;

$envFile = realpath(".env");
Env::load($envFile);

print_r($_ENV);
print_r($_SERVER);

License

Released under the MIT license., (*4)

The Versions

18/05 2017

dev-master

9999999-dev https://github.com/zrcing/phpenv

Easy to load system enivronment configuration from $_ENV,$_SERVER,getenv.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Gary Liao

server env getenv phpenv

13/09 2016

v1.0.0

1.0.0.0 https://github.com/zrcing/phpenv

Easy to load system enivronment configuration from $_ENV,$_SERVER,getenv.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Gary Liao

server env getenv phpenv