Framework agnostic configuration package supporting php and json. More file types under development.
Install
Via Composer
$ composer require blast/config
Usage
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);
Dependency injection
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);
Further development
Please visit our milestones
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.