2017 © Pedro Peláez
 

library cfg

Configuration loader

image

watoki/cfg

Configuration loader

  • Tuesday, May 12, 2015
  • by rtens
  • Repository
  • 1 Watchers
  • 0 Stars
  • 438 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

cfg Build Status

cfg is a simple configuration loader., (*1)

Usage

Given you have a configuration class name\space\MyAppConfiguration then you can overwrite it with a deployment-specific configuration name\space\MyConfiguration in a file some/folder/MyConfiguration.php and load it with, (*2)

$loader = new Loader(new Factory());
$config = $loader->loadConfiguration('name\space\MyAppConfiguration', 'some/folder/MyConfiguration.php');

This will result in MyConfiguration being set as singleton for MyAppConfiguration, so whenever the latter one is injected through the Factory, the former is used instead., (*3)

Note that MyConfiguration needs to be in the same namespace as MyAppConfiguration and the name of the containing file matches the class name., (*4)

Installation

To use cfg in your own project with Composer, add the following lines to your composer.json., (*5)

"require" : {
    "watoki/cfg" : "*"
}

The Versions

12/05 2015

dev-master

9999999-dev http://github.com/watoki/cfg

Configuration loader

  Sources   Download

MIT

The Requires

 

The Development Requires

configuration watoki