2017 © Pedro Peláez
 

library config

Simple Config Manager, Loader, and Writer.

image

glennmcewan/config

Simple Config Manager, Loader, and Writer.

  • Tuesday, May 8, 2018
  • by glennmcewan
  • Repository
  • 2 Watchers
  • 3 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Config

Total Downloads Build Status StyleCI Scrutinizer Code Quality Code Coverage, (*1)

Small but powerful Config package. Suitable for basic config handling with plain arrays or various config files, whilst remaining easy to use when scaling for use in larger applications with more complex configuration setups., (*2)

Requirements

PHP 5.5+. Master is CI tested on the following versions of PHP: 5.5, 5.6, 7.0, 7.1, and HHVM., (*3)

Installation

With Composer

$ composer require glennmcewan/config

or add the package name to the require block in your composer.json file:, (*4)

{
    "require": {
        "glennmcewan/config": "dev-master"
    }
}

Without Composer

This package can still be used without Composer -- at the cost of no included autoloader., (*5)

Usage

Basics

  • Creating a new instance of the Config Manager
$config = new Glenn\Config\Manager;

  • Setting Config Values
$config->set('name', 'Glenn');
$config->set('age', 18);
$config->set('languages', ['English', 'Spanish']);

// TODO: setting array of keys in bulk. This means re-factoring @setFromParser. It's a smelly method anyway, remove it and instead add a @setFromArray or something.

  • Getting Config values
echo $config->get('name'); // 'Glenn'

echo $config->get('age'); // 18

echo $config->get('languages'); // [0 => 'English', 1 => 'Spanish']

echo $config->get('gender'); // null

echo $config->get('gender', 'male'); // 'male'
  • Changing Config values
$config->set('name', 'Glenn');

echo $config->get('name'); // 'Glenn'

$config->set('name', 'Dave');

echo $config->get('name'); // 'Dave'

The Versions

08/05 2018

dev-readme-typo

dev-readme-typo

Simple Config Manager, Loader, and Writer.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Glenn McEwan

config

23/02 2018

dev-build-test

dev-build-test

Simple Config Manager, Loader, and Writer.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Glenn McEwan

config

14/02 2018

dev-master

9999999-dev

Simple Config Manager, Loader, and Writer.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Glenn McEwan

config