Framework agnostic configuration package supporting php and json. More file types under development.
Via Composer
$ composer require blast/config
Only a few lines of code:
<?php
$factory = new Factory();
// define your base location for all configurations
$locator = $factory->create(__DIR__ . '/res');
// receive config from json as array
$config = $factory->load('/config/config.json', $locator);
// receive config as array
$config = $factory->load('/config/config.php', $locator);
Configure ServiceProvider and Facade.
<?php
$container = new Container();
$container->addServiceProvider(new ConfigServiceProvider());
FacadeFactory::setContainer($container);
Load your configuration.
<?php
// define your base location for all configurations
Config::create(__DIR__ . '/res');
// receive config from json as array
$config = Config::load('/config/config.json', $locator);
Please visit our milestones
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email :author_email instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.