2017 © Pedro Peláez
 

library hierarchical-config

Provides inheritance and hierarchical configuration tools.

image

bshirey/hierarchical-config

Provides inheritance and hierarchical configuration tools.

  • Friday, June 26, 2015
  • by bshirey
  • Repository
  • 1 Watchers
  • 0 Stars
  • 38 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

# Hierarchical Config

Documentation on its way. This is a tool to assist in creating hierarchical configurations, where layers of configuration data are merged, with higher layers overwriting lower layers., (*1)

# How To Use

First, you must add this library to your project. If you are using composer, try this:, (*2)

composer require bshirey/hierarchical-config:1.*, (*3)

This library does not do much on its own, but requires some setup in your project. At a minimum, you must implement your own ConfigBuilder with a custom implementation of the build() function. The ConfigBuilder is responsible to instantiating ConfigInterface objects. The ConfigBuilder is responsible for stacking ConfigInterface objects hierarchically., (*4)

For example:, (*5)

    public class MyApplicationConfigBuilder implements ConfigBuilder
    {
        public function build($options = array())
        {
            $config = new GenericConfig($options);
            $config
                ->push(new FileConfig($options))
                ->push(new GlobalsConfig($options))
                ->push(new EnvConfig($options));

            return $config;
        }
        ...

Then your application needs to setup the ConfigFactory singleton, similar to the following:, (*6)

    ConfigFactory::getInstance()
                ->setOptions($options)
                ->setBuilder(new MyApplicationConfigBuilder());

Finally, you must make your configurable classes / objects use the HierarchicalConfig\Configurable trait:, (*7)

    use HierarchicalConfig\Configurable;

    public class MyApplicationClass
    {
       use Configurable;
       ...

# How To Run The Tests

This glosses over the details a bit. Needless to say you need to have composer installed as well as phpunit and any dependencies., (*8)

  • Run composer install if you haven't already. This installs project dependencies.
  • Run phpunit.
  • Let the tests run.

The Versions

26/06 2015

dev-master

9999999-dev

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

26/06 2015

v1.1.3

1.1.3.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

25/06 2015

v1.1.2

1.1.2.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

25/06 2015

v1.1.1

1.1.1.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

24/06 2015

dev-feature/filters

dev-feature/filters

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

24/06 2015

1.1.0

1.1.0.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

v1.0.2

1.0.2.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

1.0.1

1.0.1.0

Provides inheritance and hierarchical configuration tools.

  Sources   Download

The Requires

 

by Brian Shirey

20/06 2015

v1.0

1.0.0.0

This is a Selenium + PHPUnit Framework and test skeleton

  Sources   Download

The Requires

 

by Brian Shirey