2017 © Pedro Peláez
 

library config

Makes loading and using config files easier

image

emmetog/config

Makes loading and using config files easier

  • Sunday, January 22, 2017
  • by emmetog
  • Repository
  • 2 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

emmetog/config

Handles configuration files and settings in a neat package., (*1)

This package is the heart of many other packages. The config object is a dependency injection container which is passed to other objects on their contruction. Then that object will be able to get all its settings from the config object. This makes it possible to give two different instances of the same object different config objects and have them behave differently! Cool huh!, (*2)

This package contains two different classes:, (*3)

  • Config (The real config object)
  • ConfigForMocking (A 'fake' config object, useful in unit tests when we want to give errors when unmocked configs are used)

Installation

This package is easy to install using Composer, to get started just add it to your composer.json file., (*4)

For example:, (*5)

"require": {
    "emmetog/config":    "1.0.*",
    "emmetog/cache":     "1.0.*",
}

This package requires the Emmetog\Cache package, that's why it's also required above., (*6)

Usage

Just create the object you want and use it, for example:, (*7)

$config = new Emmetog\Config\Config('/project/path/config/', new NullCache());

// Get the 'text_color' config variable from the 'theme.config.php' config file.
$textColor = $config->getConfiguration('theme', 'text_color');

In the example above the file 'theme.config.php' should have something like this inside:, (*8)

<?php
# File /project/path/config/theme.config.php
$config['text_color'] = 'red';
?>

Miscellaneous

This package follows the semantic versioning guidelines., (*9)

The Versions

22/01 2017

dev-master

9999999-dev

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

22/01 2017

v2.1.1

2.1.1.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

29/07 2013

v2.1.0

2.1.0.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

28/07 2013

v2.0.0

2.0.0.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

26/07 2013

v1.2.1

1.2.1.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

26/07 2013

v1.2.0

1.2.0.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

19/05 2013

v1.1.0

1.1.0.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

13/05 2013

v1.0.0

1.0.0.0

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config

01/05 2013

v1.0.0-alpha1

1.0.0.0-alpha1

Makes loading and using config files easier

  Sources   Download

GPL-3.0

The Requires

 

config