PHP Config Library.
composer require marella/phig
<?php
require 'vendor/autoload.php';
$loader = new \Phig\ConfigLoader();
$config = $loader->read(__DIR__.'/config');
$timezone = $config['app.timezone']; // 'UTC'
$locale = $config['app']['locale']; // 'en'
$database = $config['database']; // array
$host = $database['host']; // 'localhost'
where config
directory contains these files:
app.php
<?php
return [
'timezone' => 'UTC',
'locale' => 'en',
];
database.php
<?php
return [
'host' => 'localhost',
'database' => 'forge',
'username' => 'forge',
'password' => '',
];
See the wiki for more details and documentation.
See contributing guidelines before creating issues or pull requests.
Open-source software released under the MIT license.