genesis/config

There is no license information available for the latest version (1.0.0) of this package.

Simple way to manage config for multiple environments.

1.0.0 2019-01-15 10:31 UTC

This package is not auto-updated.

Last update: 2024-10-31 16:15:57 UTC


README

A very simple way to manage config based on environments.

$ composer require genesis/config

Usage

Create database.json file with the following content:

{
    "development": {
        "name": "",
        "username": "",
        "password": ""
    },
    "staging": {
        "name": "",
        "username": "",
        "password": ""
    },
    "production": {
        ...
    }
}
const ENVIRONMENT = 'development';
const PATH = __DIR__ . '/allJsonConfigs/';

$config = new Config(self::PATH, self::ENVIRONMENT);
$dbname = $config->set('database')->get('name');
$username = $config->get('username');
$password = $config->get('password');