crysalead / env
Environment variable container
Installs: 17 431
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- crysalead/collection: ^3.0
Requires (Dev)
- kahlan/kahlan: ~3.0
This package is auto-updated.
Last update: 2024-10-29 03:58:47 UTC
README
Environment variable container.
Installation
composer require crysalead/env
API
Example
use Lead\Env\Env; $env = new Env($_SERVER + $_ENV); $env['PHP_SELF']; $env['UNEXISTING_VARIABLE']; // returns `false` like `getenv()` on undefined $env['CUSTOM_VARIABLE'] = 'myvalue'; // Multiple set $env->set([ 'CUSTOM_VARIABLE2' => 'myvalue2', 'CUSTOM_VARIABLE3' => 'myvalue3' ]); isset($env['CUSTOM_VARIABLE']); unset($env['CUSTOM_VARIABLE']); $env->clear(); // removes all variables.