PHPackages                             watoki/cfg - 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. watoki/cfg

ActiveLibrary

watoki/cfg
==========

Configuration loader

0461PHP

Since May 12Pushed 11y ago1 watchersCompare

[ Source](https://github.com/watoki/cfg)[ Packagist](https://packagist.org/packages/watoki/cfg)[ RSS](/packages/watoki-cfg/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

cfg [![Build Status](https://camo.githubusercontent.com/92caa6e2f76ad147538b8b3d83d98fe4b3ef0906ce4587d2412b39460362f8a1/68747470733a2f2f7472617669732d63692e6f72672f7761746f6b692f6366672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/watoki/cfg)
=================================================================================================================================================================================================================================================================

[](#cfg-)

*cfg* is a simple configuration loader.

Usage
-----

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

```
$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.

Note that `MyConfiguration` needs to be in the same namespace as `MyAppConfiguration` and the name of the containing file matches the class name.

Installation
------------

[](#installation)

To use cfg in your own project with [Composer](http://getcomposer.org/), add the following lines to your `composer.json`.

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

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e687108526c164e4ad1c49b8228514541bd90d43ef70665a087d00e34a1f7559?d=identicon)[rtens](/maintainers/rtens)

---

Top Contributors

[![rtens](https://avatars.githubusercontent.com/u/1468866?v=4)](https://github.com/rtens "rtens (12 commits)")

### Embed Badge

![Health badge](/badges/watoki-cfg/health.svg)

```
[![Health](https://phpackages.com/badges/watoki-cfg/health.svg)](https://phpackages.com/packages/watoki-cfg)
```

PHPackages © 2026

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