1. Go to this page and download the library: Download roolith/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/ */
use Roolith\Configuration\Config;
define('ROOLITH_CONFIG_ROOT', __DIR__. '/config');
print_r(Config::get('database')); // generalDatabase
use Roolith\Configuration\Config;
'/config');
define('ROOLITH_ENV', 'production'); // set environment varible
// Config::setEnv('development'); // another way to set env
var_dump(Config::get('database')); // result will be `productionDatabase`
var_dump(Config::env()); // production
Config::setEnv('production');
Config::get('a.b'); // c
Config::get('staging.database', true); // true means it will skip auto set environment
text
development.config.php
production.config.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.