artox-lab / json-config
There is no license information available for the latest version (1.5.1) of this package.
Yet Another JSON config for PHP
1.5.1
2021-01-19 15:56 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 4.*
README
Installation via Composer
{
"require": {
"artox-lab/json-config": "1.3.1"
}
}
Run composer update
Config Definition
config.json
{
"name": "Suppa Project",
"version": 1,
"rating": 2.5,
"authors": [
"code.god@gmail.com"
],
"emails": {
"subscription": [
"user1@gmail.com",
"user2@gmail.com"
],
"user": {
"name": "Johny"
},
"should_notify": true
}
}
Config Usage
index.php
<?php include 'vendor/autoload.php'; // Setup path to config file JsonConfig\Config::setup('config.json'); // Get data from config $subscriptions = JsonConfig\Config::get('emails.subscription');