This library is a configuration file loader in PHP that supports JSON and PHP files at the moment.
- PHP >=7.1
composer require thiphariel/config-file-loader
// Create an instance of Config
$config = new Config();
// Load JSON configuration file
$config->load("config.json");
// Load PHP configuration file
$config->load("config.php");
// Getting values
$host = $config->get("host");
$port = $config->get("port");
// Nested keys
$env = $config->get("environment.dev");
Examples of configurations can be found in the tests/config
folder.