Download the PHP package bshirey/hierarchical-config without Composer
On this page you can find all versions of the php package bshirey/hierarchical-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bshirey/hierarchical-config
More information about bshirey/hierarchical-config
Files in bshirey/hierarchical-config
Package hierarchical-config
Short Description Provides inheritance and hierarchical configuration tools.
License
Informations about the package hierarchical-config
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.
How To Use
============
First, you must add this library to your project. If you are using composer, try this:
composer require bshirey/hierarchical-config:1.*
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.
For example:
Then your application needs to setup the ConfigFactory singleton, similar to the following:
Finally, you must make your configurable classes / objects use the HierarchicalConfig\Configurable trait:
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.
- Run composer install if you haven't already. This installs project dependencies.
- Run phpunit.
- Let the tests run.