PHPackages                             acgrid/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. acgrid/config

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

acgrid/config
=============

Configuration manager with deferred default value, transformation and caching.

1.0.0(7y ago)16MITPHPPHP ^7.2

Since Oct 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/acgrid/config.php)[ Packagist](https://packagist.org/packages/acgrid/config)[ RSS](/packages/acgrid-config/feed)WikiDiscussions master Synced yesterday

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

Config.php
==========

[](#configphp)

Features
--------

[](#features)

- Collection for configuration items
- Deferred item definition, item is never defined until it is used
- Self-descriptive, with IDE auto-completion powered
- Deferred resolution of current and default value
- Enumeration and export for administrative script and manager
- Full control for populating pre-loaded data
- Caching via PHP's ultra-fast APCu with write-back on demand
- Shipped with some helpers for quick reader and writer

Usage
-----

[](#usage)

### Definition

[](#definition)

Extend `Collection` with each definition a public function

An Live Template of PHPStorm like this can be added to make a shortcut

```
public function $CONF_NAME$(): Item
{
    return $this->make(__FUNCTION__, $DEF_VALUE$, $READER$, $WRITER$);
}
```

### Source

[](#source)

Instantiate your own `Loader` with a callback that return the array of raw data of configuration. The key shall be the Collection's FQN. Just `require` the dumped file in case of using a saved php configuration file. Call `setApcu('key_prefix')` to enable APCu caching.

### Routines

[](#routines)

Instantiate needed children instance of `Collection`, which a DI container is suggested to fulfil the task. Pass the loader in previous step. Then you call get the configuration by `$collection->item()()`. Note that `__invoke()` is used. Otherwise what you get is a `Item` object having many useful methods like `def()` and `raw()`.

See tests for more detailed usage.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2769d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7407146?v=4)[acgrid](/maintainers/acgrid)[@acgrid](https://github.com/acgrid)

---

Top Contributors

[![acgrid](https://avatars.githubusercontent.com/u/7407146?v=4)](https://github.com/acgrid "acgrid (10 commits)")

---

Tags

apcuconfiguration-managementphp-libraryphp72

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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