PHPackages                             geeklab/conf - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. geeklab/conf

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

geeklab/conf
============

Immutable configuration system for PHP &gt;= 8.1

4.0.0(3y ago)232GPL-3.0-or-laterPHPPHP &gt;=8.1CI failing

Since Nov 24Pushed 3w ago2 watchersCompare

[ Source](https://github.com/ellisgl/GeekLab-Conf)[ Packagist](https://packagist.org/packages/geeklab/conf)[ RSS](/packages/geeklab-conf/feed)WikiDiscussions release Synced 3w ago

READMEChangelogDependencies (5)Versions (17)Used By (0)

[![License: BSD](https://camo.githubusercontent.com/047d1656a91f95d97fda390c227ed2c135cafc1107ee66831762dd83d67c09e4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d79656c6c6f772e737667)](https://opensource.org/licenses/BSD-3-Clause)[![phpstan enabled](https://camo.githubusercontent.com/96cefcabfaf3777e8f933f973a7ea208f547fe88769e87f0579d1a83eea5e6b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d656e61626c65642d677265656e2e737667)](https://github.com/phpstan/phpstan)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2873421150f61a530f200c4286881d6dc53bad0e586d2fe7c3fd940860acf90a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c6c6973676c2f4765656b4c61622d436f6e662f6261646765732f7175616c6974792d73636f72652e706e673f623d72656c65617365)](https://scrutinizer-ci.com/g/ellisgl/GeekLab-Conf/?branch=release)[![Code Coverage](https://camo.githubusercontent.com/e38fe4c297b6b39a7b3b78f29fd168b9294f49a6e457f1e8ba75ef68aa922079/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c6c6973676c2f4765656b4c61622d436f6e662f6261646765732f636f7665726167652e706e673f623d72656c65617365)](https://scrutinizer-ci.com/g/ellisgl/GeekLab-Conf/?branch=release)

geeklab/conf
============

[](#geeklabconf)

Immutable configuration system loader &amp; parser for PHP &gt;= 8.1 that supports multiple file formats and has some templating features. This library is an alternative to '.env' type configuration libraries and uses the [Strategy Pattern](https://designpatternsphp.readthedocs.io/en/latest/Behavioral/Strategy/README.html).

### [Benchmarks](https://github.com/ellisgl/php-benchmarks/blob/master/results/Confs.md)

[](#benchmarks)

Latest
------

[](#latest)

4.0.0 (2020-11-24): Updating to more &gt;= 8.1.0 compatible.

Features:
---------

[](#features)

- Multi-file configuration loading, no more monolithic configurations!
- Self referencing placeholders. `@[X.Y.Z]`
- Recursive self referencing placeholders. `@[@[X.Y.Z].SOME_KEY]`
- Environment variable placeholders. `$[ENVIRONMENT_VARIABLE_NAME]` (PHP likes `${YOUR_TEXT_HERE}` a little too much...)
- Can use INI, JSON, YAML and Array files.
- Immutability, since you shouldn't change your configuration during run time.
- Can inject values, to make things really dynamic.

Installation:
-------------

[](#installation)

composer require geeklab/conf

Usage:
------

[](#usage)

Basic:

```
// Where the configurations are.
$configurationDirectory = __DIR__ . '/config/';

// Load Configuration system with the JSON Configuration Driver
$configuration = new GLConf(
    new JSONConfDriver(
        $configurationDirectory . 'system.json',  // Path and file name of main (top level) configuration.
        $configurationDirectory                   // Path to the other configuration files.
    ),
    ['mySecretKey' => md5(rand())],                // Value injections.
    ['keys_to_lower']                              // Options:
                                                   //  Options to change the case of the key if returning a keyed array:
                                                   //  keys_upper_case, keys_lower_case, keys_same_case
);

$configuration->init();

// Get the whole configuration.
var_export($configuration->getAll());

// Get one item.
var_export($configuration->get('space_pants.look_at_my'));
```

Detailed:

- [INI](/docs/INI.md)
- [Array](/docs/Array.md)
- [JSON](/docs/JSON.md)
- [YAML](/docs/YAML.md)

PSR Compliance:

- PSR-1
- PSR-2
- PSR-4
- PSR-12

Todo:
-----

[](#todo)

- More Documentation.
- Include .env?

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance62

Regular maintenance activity

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 87.1% 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 ~104 days

Total

15

Last Release

1307d ago

Major Versions

1.0.0 → 2.0.02019-05-30

2.0.7 → 3.0.02021-09-18

3.2.2 → 4.0.02022-11-24

PHP version history (4 changes)1.0.0PHP &gt;=7.1

2.0.0PHP &gt;=7.2

3.0.0PHP &gt;=7.4

4.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![ellisgl](https://avatars.githubusercontent.com/u/94559?v=4)](https://github.com/ellisgl "ellisgl (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

arrayconfigurationenvironmentinijsonphpphp7php7-4php74php81yaml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/geeklab-conf/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[mnapoli/front-yaml

YAML Front matter parser

2855.6M50](/packages/mnapoli-front-yaml)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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