PHP code example of amtgard / environment-loader

1. Go to this page and download the library: Download amtgard/environment-loader 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/ */

    

amtgard / environment-loader example snippets


use Amtgard\EnvironmentLoader\EnvironmentLoader;

$environment = getenv('APP_ENV') ?: 'environment-one';

$envLoad = EnvironmentLoader::builder()
    ->build()
    ->defaultPath('environment-one', '/path/to/live/container')
    ->defaultPath('environment-two', '/path/to/integ/container');

$envLoad->register('oauth')
    ->withEnvironment('environment-one', 'oauth-providers.php', EnvironmentLoader::DEFAULT)
    ->withEnvironment('environment-two', 'oauth-providers-integ.php');

(