2017 © Pedro Peláez
 

library kunfig

Helper library to easily merge & use multiple configuration files.

image

vaibhavpandeyvpz/kunfig

Helper library to easily merge & use multiple configuration files.

  • Sunday, January 22, 2017
  • by vaibhavpandeyvpz
  • Repository
  • 1 Watchers
  • 2 Stars
  • 96 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

vaibhavpandeyvpz/kunfig

Helper library to easily merge & use multiple configuration files., (*1)

Build status ![Code Coverage][code-coverage-image] ![Latest Version][latest-version-image] ![Downloads][downloads-image] ![PHP Version][php-version-image] ![License][license-image], (*2)

SensioLabsInsight, (*3)

Install

composer require vaibhavpandeyvpz/kunfig

Usage

<?php

/**
 * @desc Create a Kunfig\Config instance with some initial values
 *      passed into constructor.
 */
$config = new Kunfig\Config(array(
    'database' => array(
        'host' => 'localhost',
        'port' => 3306,
        'charset' => 'utf8mb4',
    ),
    'debug' => false,
));

// Get a value
$host = $config->database->host;

// Set a value
$config->database->host = 'xxxxxxxxxxxxx.xxxxxxxxxxxxx.us-west-2.rds.amazonaws.com';

$override = new Kunfig\Config(array(
    'database' => array(
        'name' => 'test',
        'user' => 'root',
        'password' => null,
    ),
));

/**
 * @desc You can mix two Kunfig\ConfigInterface; the latter one
 *      will override values in the original one.
 */
$config->mix($override);

$pdo = new PDO(
    "mysql:host={$config->database->host}:{$config->database->port};dbname={$config->database->name}",
    $config->database->user,
    $config->database->password
);

License

See LICENSE.md file., (*4)

The Versions

22/01 2017

dev-master

9999999-dev http://vaibhavpandeyvpz.github.io/kunfig

Helper library to easily merge & use multiple configuration files.

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

php configuration manager multiple

22/01 2017

1.0

1.0.0.0 http://vaibhavpandeyvpz.github.io/kunfig

Helper library to easily merge & use multiple configuration files.

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

php configuration manager multiple