library env-php
A utility that provides several functions for accessing environment variables.
r3n0e0/env-php
A utility that provides several functions for accessing environment variables.
- Friday, July 21, 2017
- by r3n0e0
- Repository
- 0 Watchers
- 0 Stars
- 4 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
env-php
, (*1)
This is a utility that provides several functions for accessing environment variables., (*2)
Inspired by the env library for Python., (*3)
Example Usage
Environment variables:, (*4)
GITHUB_USER=xxx
GITHUB_TOKEN=yyy
API_TOKEN=zzz
Easy to use as follows:, (*5)
>>> require __DIR__ . '/vendor/autoload.php';
>>> use EnvPHP\Env;
>>> $env = Env::prefix('GITHUB_');
>>> var_dump($env);
array(2) {
'user' =>
string(3) "xxx"
'token' =>
string(3) "yyy"
}
>>> $env = Env::suffix('_TOKEN');
>>> var_dump($env);
array(2) {
'github' =>
string(3) "yyy"
'api' =>
string(3) "zzz"
}
Thanks
dev-master
9999999-dev
A utility that provides several functions for accessing environment variables.
Sources
Download
MIT
The Requires
The Development Requires
by
ren
0.1.0
0.1.0.0
A utility that provides several functions for accessing environment variables.
Sources
Download
MIT
The Requires
The Development Requires
by
ren