PHPackages                             bshirey/hierarchical-config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bshirey/hierarchical-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bshirey/hierarchical-config
===========================

Provides inheritance and hierarchical configuration tools.

v1.1.3(10y ago)0501PHPPHP &gt;=5.4.0

Since Jun 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/abtincbrians/HierarchicalConfig)[ Packagist](https://packagist.org/packages/bshirey/hierarchical-config)[ RSS](/packages/bshirey-hierarchical-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (1)

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
==========

[](#how-to-use)

============

First, you must add this library to your project. If you are using composer, try this: &gt; 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:

```
    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:

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

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

```
    use HierarchicalConfig\Configurable;

    public class MyApplicationClass
    {
       use Configurable;
       ...
```

How To Run The Tests
====================

[](#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.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

3979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2000c81988b47c2eb8c5b1e4d7bcfdb24012d26754f135d5ad43c2cfa91b6828?d=identicon)[bshirey](/maintainers/bshirey)

---

Top Contributors

[![abtincbrians](https://avatars.githubusercontent.com/u/6011012?v=4)](https://github.com/abtincbrians "abtincbrians (1 commits)")

### Embed Badge

![Health badge](/badges/bshirey-hierarchical-config/health.svg)

```
[![Health](https://phpackages.com/badges/bshirey-hierarchical-config/health.svg)](https://phpackages.com/packages/bshirey-hierarchical-config)
```

###  Alternatives

[ramsey/devtools

A Composer plugin to aid PHP library and application development.

7134.7k26](/packages/ramsey-devtools)[jimbojsb/workman

PHP process forking &amp; daemonizing library

608.8k](/packages/jimbojsb-workman)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
