PHP code example of touta / eolas-config

1. Go to this page and download the library: Download touta/eolas-config 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/ */

    

touta / eolas-config example snippets


use Touta\Eolas\ConfigRepository;
use Touta\Eolas\ArrayLoader;

$loader = new ArrayLoader(['app' => ['name' => 'MyApp', 'debug' => true]]);
$config = ConfigRepository::fromLoader($loader);

$name = $config->get('app.name');    // Success('MyApp')
$missing = $config->get('app.foo');  // Failure(...)