2017 © Pedro Peláez
 

library php-config

Config libs provides interface for loading config. Local, User-base, System-base, App-base.

image

tacoberu/php-config

Config libs provides interface for loading config. Local, User-base, System-base, App-base.

  • Saturday, April 14, 2018
  • by tacoberu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Config

Config libs provides interface for loading config. Local, User-base, System-base, App-base., (*1)

Use case

$config = Config::createByEnvironment('doe', null, getcwd()); // doe is application name
$config->has('name'); // true
$config->required('name'); // John
$config->required('core.name'); // Andrey
$config->required('lang[5].name'); // germany
$config->required('lang[de].name'); // germany
$config->required('core'); // [ name => Andrey, age => 42 ]
$config->required('nope'); // exception
$config->get('nope'); // NULL
$config->get('nope', 'Mark'); // Mark

Default configuration

$config = Config::createByEnvironment('doe', __dir__ . '/default.json', getcwd());

Own Parser

$config = Config::createByEnvironment('doe', __dir__ . '/default.xml', getcwd());
$config->addParser(new XmlParser);

Source of configuration

Configuration is loading from:, (*2)

system:

  • Linux: /etc/doe.ini
  • MacOS: /private/etc/doe.ini
  • Win: ?

user:

  • Linux: /home/current-user/.config/doe/config.ini
  • MacOS: /Users/current-user/.config/doe/config.ini
  • Win: ?

local:

./doe.ini, (*3)

Buildin format

  • ini
  • json

TODO

  • own loader
  • include
  • merge parent

The Versions

14/04 2018

dev-master

9999999-dev

Config libs provides interface for loading config. Local, User-base, System-base, App-base.

  Sources   Download

MIT

The Requires

 

The Development Requires

json configuration ini config

14/04 2018

v1.0.x-dev

1.0.9999999.9999999-dev

Config libs provides interface for loading config. Local, User-base, System-base, App-base.

  Sources   Download

MIT

The Requires

 

The Development Requires

json configuration ini config