2017 © Pedro Peláez
 

library config

Configuration handler

image

codzo/config

Configuration handler

  • Friday, October 20, 2017
  • by neilfan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Config

Configuration handler., (*1)

This package will read configuration files from a directory and allow retrieval of data in several ways., (*2)

Installation

composer require codzo/config

Usage

$config = new \Codzo\Config\Config('./config');

// retrieve the config
$app = $config->get('app');
$enabled = $app['ini']['enabled'];

// or quickly
$enabled = $config->get('app.ini.enabled');

The configuration directory

This package requires a directory as home to all configuration files. Files in this directory will be considered as configuration files if filetype supported., (*3)

This package will not load any file in sub-directory., (*4)

The configuration files

These file types are supported: + php + ini + xml, (*5)

PHP configuration files shall return an array., (*6)

INI files will be parsed using parse_ini_file() method., (*7)

XML files will be parsed using simplexml_load_file() method., (*8)

The configuration loaded from all files will then be merged together. Duplicated items will be overwritten without any warning., (*9)

Retrieve the configuration

Configurations can be retrieved in several ways. + as an array: Use keys to navigate in multiplication arrays + quick search: Concat the keys into a path and get the configuration quickly., (*10)

The Versions

20/10 2017

dev-master

9999999-dev https://github.com/codzo/Config

Configuration handler

  Sources   Download

Apache License

The Requires

  • php >=5.3.0

 

The Development Requires

config setting