1. Go to this page and download the library: Download spacetab-io/configuration 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/ */
spacetab-io / configuration example snippets
use Spacetab\Configuration\Configuration;
$conf = new Configuration();
$conf->load();
var_dump($conf->all()); // get all config
echo $conf->get('foo.bar'); // get nested key use dot notation
echo $conf['foo.bar']; // the same, but use ArrayAccess interface.
use Spacetab\Configuration\Configuration;
$conf = new Configuration(__DIR__ . '/configuration', 'test');
$conf->load();
$conf->get('key'); // full example on the top
use Spacetab\Configuration\Configuration;
$conf = new Configuration();
$conf->load(); // loaded files from /configuration for prod stage.
$conf->get('key'); // full example on the top
use Spacetab\Configuration\Configuration;
$conf = new Configuration();
$conf->setLogger($monolog); // PSR compatible logger.
$conf->load();
$conf->get('key'); // full example on the top