1. Go to this page and download the library: Download yammerjp/envgen library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yammerjp / envgen example snippets
App\EnvironmentVariables;
$env = EnvironmentVariables::load();
echo $env->getEnvironment(); // string
echo $env->getApiPort(); // int
var_dump($env->getDebugMode()); // bool or null
// For testing - pass custom environment variables
$config = Config::load([
'VAR_ONE' => 'test-value',
'VAR_TWO' => '42',
]);
// In production - uses getenv() by default
$config = Config::load();
bash
docker-compose run --rm php composer install
bash
docker-compose run --rm php vendor/bin/phpunit
bash
docker-compose run --rm php composer test
bash
docker-compose run --rm php bin/envgen example/envgen.yaml
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.