artox-lab / json-config
Yet Another JSON config for PHP
Installs: 8 120
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
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');