indgy / config
Simple array config access
0.1.0
2023-01-18 08:47 UTC
Requires
- php: ~7.4 || ~8.0
- adbario/php-dot-notation: ~2.2 || ~3.1
README
Simple array config access
Install
Install this package via composer:
composer install ignition-studios/config
Usage
Config expects an associative array as the constructor input.
It has one method which will return the value of the specified key.
$config = new Config([ "api" => [ "user" => "Alex", "pass" => "sEcReT", ], "theme" => "dark", ]); $config->get("theme"); <!-- dark --> $config->get("api"); <!-- [ "user" => "Alex", "pass" => "sEcReT", ] -->
The get()
method will return a default value if the key is not found
$config->get("size", "medium"); <!-- medium -->
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ make test
Contributing
Please see CONTRIBUTING for details.
Credits
License
Proprietary
The code in this repository is proprietary, unauthorised reproduction or distribution is forbidden. Written authorisation may only be granted by a Director of Ignition Studios Ltd.