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

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

jaxon-php/jaxon-config
======================

Save config options in immutable objects.

v1.0.0(1y ago)21.5k↓50%2BSD-3-ClausePHPPHP &gt;=8.0CI passing

Since Mar 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/jaxon-php/jaxon-config)[ Packagist](https://packagist.org/packages/jaxon-php/jaxon-config)[ Docs](https://www.jaxon-php.org)[ RSS](/packages/jaxon-php-jaxon-config/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (2)

[![Build Status](https://github.com/jaxon-php/jaxon-config/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/jaxon-php/jaxon-config/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e393c042bd01ca389ff649b412a59ef595e327832567a5b79b82d7859c69fa19/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a61786f6e2d7068702f6a61786f6e2d636f6e6669672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/jaxon-php/jaxon-config/?branch=main)[![StyleCI](https://camo.githubusercontent.com/3418f434d7f73bfb9f9378c9acf289cbbc5bb0945b491b8d450801dce5697aec/68747470733a2f2f7374796c6563692e696f2f7265706f732f3931363331383434372f736869656c643f6272616e63683d6d61696e)](https://styleci.io/repos/916318447)[![codecov](https://camo.githubusercontent.com/85c2927a86d227c80555fa27fa2edc6358b924bc897b692bb02b808ea7a93d22/68747470733a2f2f636f6465636f762e696f2f67682f6a61786f6e2d7068702f6a61786f6e2d636f6e6669672f67726170682f62616467652e7376673f746f6b656e3d74675243656d466f7461)](https://codecov.io/gh/jaxon-php/jaxon-config)

[![Latest Stable Version](https://camo.githubusercontent.com/fc98fb50ac839a2921137994d8eb58ad3e169a3fdbc311f9d11c162fa3efcea0/68747470733a2f2f706f7365722e707567782e6f72672f6a61786f6e2d7068702f6a61786f6e2d636f6e6669672f762f737461626c65)](https://packagist.org/packages/jaxon-php/jaxon-config)[![Total Downloads](https://camo.githubusercontent.com/48f1024648bb0b063e8040806220855195edeff8ef7167a3f8066a21c6a8da01/68747470733a2f2f706f7365722e707567782e6f72672f6a61786f6e2d7068702f6a61786f6e2d636f6e6669672f646f776e6c6f616473)](https://packagist.org/packages/jaxon-php/jaxon-config)[![License](https://camo.githubusercontent.com/060962cffb1c7058dabdc5ceb6f1284991cd6276463787035bd6707286ec3490/68747470733a2f2f706f7365722e707567782e6f72672f6a61786f6e2d7068702f6a61786f6e2d636f6e6669672f6c6963656e7365)](https://packagist.org/packages/jaxon-php/jaxon-config)

Jaxon Config
============

[](#jaxon-config)

Jaxon Config saves config options in immutable objects.

**Install**

```
composer require jaxon-php/jaxon-config
```

**Usage**

Create a config setter.

```
$setter = new \Jaxon\Config\ConfigSetter();
```

Create a config object with initial value.

```
/** @var \Jaxon\Config\Config */
$config = $setter->newConfig([
    'a' => [
        'b' => [
            'c' => 'Value',
        ],
    ],
]);
```

Create a config reader.

```
$reader = new \Jaxon\Config\ConfigReader($setter);
```

Read config options from a file.

```
// A new config object is returned.
// From a PHP file.
$config = $reader->load($config, '/path/to/config/file.php');
// Or from a YAML file.
$config = $reader->load($config, '/path/to/config/file.yaml');
// Or from a JSON file.
$config = $reader->load($config, '/path/to/config/file.json');
```

Create an empty config object and set values.

```
/** @var \Jaxon\Config\Config */
$config = $setter->newConfig();
// A new config object is returned.
$config = $setter->setOptions($config, [
    'a' => [
        'b' => [
            'c' => 'Value',
        ],
    ],
]);
```

Read values.

```
$config->getOption('a'); // Returns ['b' => ['c' => 'Value']]
$config->getOption('a.b'); // Returns ['c' => 'Value']
$config->getOption('a.b.c'); // Returns 'Value'
```

Set a single value.

```
// A new config object is returned.
$config = $setter->setOption($config, 'a.b.d', 'Another value');
```

Read values.

```
$config->getOption('a'); // Returns ['b' => ['c' => 'Value', 'd' => 'Another value']]
$config->getOption('a.b'); // Returns ['c' => 'Value', 'd' => 'Another value']
$config->getOption('a.b.c'); // Returns 'Value'
$config->getOption('a.b.d'); // Returns 'Another value'
```

Set values with a prefix.

```
// A new config object is returned.
$config = $setter->setOptions($config, [
    'd' => [
        'e' => 'Overwritten value',
    ],
    'f' => ['Array', 'Of', 'Values'],
], 'a.b');
```

Read values.

```
$config->getOption('a.b'); // Returns ['c' => 'Value', 'd' => ['e' => 'Overwritten value']]
$config->getOption('a.b.d'); // Returns ['e' => 'Overwritten value']
$config->getOption('a.b.d.e'); // Returns 'Overwritten value'
$config->getOption('a.b.f'); // Returns ['Array', 'Of', 'Values']
```

Create a new config object.

```
/** @var \Jaxon\Config\Config */
$config = $setter->newConfig([
    'b' => [
        'c' => 'Value',
    ],
    'd' => 'Value',
    'e' => 'Value',
    'f' => 'Value',
], 'a');
```

Read values.

```
$config->getOption('a'); // Returns ['b' => ['c' => 'Value'], 'd' => 'Value', 'e' => 'Value', 'f' => 'Value']
```

Remove an entry.

```
// A new config object is returned.
$config = $setter->unsetOption($config, 'a.e');
```

Read values.

```
$config->getOption('a'); // Returns ['b' => ['c' => 'Value'], 'd' => 'Value', 'f' => 'Value']
```

Remove multiple entries.

```
// A new config object is returned.
$config = $setter->unsetOptions($config, ['a.f', 'a.b']);
```

Read values.

```
$config->getOption('a'); // Returns ['d' => 'Value']
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance61

Regular maintenance activity

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

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

442d ago

### Community

Maintainers

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

---

Top Contributors

[![feuzeu](https://avatars.githubusercontent.com/u/15174329?v=4)](https://github.com/feuzeu "feuzeu (14 commits)")

---

Tags

configimmutableoptionsconfigoptionsimmutable

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[sandrokeil/easy-config

Zend Framework 2 (zf2) module to retrieve specific module options and provides some abstract factories to create easily instances depending on configuration

113.1k1](/packages/sandrokeil-easy-config)

PHPackages © 2026

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