PHPackages                             thewunder/conphigure - 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. thewunder/conphigure

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

thewunder/conphigure
====================

Framework Agnostic Configuration Library

3.1(5mo ago)3115.9k↓18.3%MITPHPPHP &gt;=8.1CI passing

Since Sep 21Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/thewunder/conphigure)[ Packagist](https://packagist.org/packages/thewunder/conphigure)[ Docs](https://github.com/thewunder/conphigure)[ RSS](/packages/thewunder-conphigure/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (15)Used By (0)

Conphigure
==========

[](#conphigure)

[![Latest Version on Packagist](https://camo.githubusercontent.com/49e00a6ad7c385ae6b144892ebf20e4f52c13a0135944b9b1e6dcb6efa36f00d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74686577756e6465722f636f6e706869677572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thewunder/conphigure)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/715cffd00d176c72404c1926e08b8835be76244173df12d4ebde89866505bb3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74686577756e6465722f636f6e706869677572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thewunder/conphigure)

Conphigure is a framework agnostic library for reading and retrieving configuration. If your application has outgrown a single configuration file this library will be a good choice.

It can read configuration files in the following formats:

- php
- yaml
- json
- xml
- ini
- dotenv

Conphigure can also read entire directories containing configuration files.

Install
-------

[](#install)

Via Composer

```
$ composer require thewunder/conphigure
```

Usage
-----

[](#usage)

If you have configuration in myfile.yml

```
smtp:
  host: smtp.mycompany.com
  port: 25
```

Read it in your php application like the following

```
$config = Conphigure::create();

//load configuration from a single file
$config->read('/directory/myfile.yml');

//get a value
$port = $config->get('smtp/port');

//add configuration from somewhere else (cache / database / etc)
$arrayFromSomewhere = [
     'database' => [
         'host' => 'localhost'
     ]
 ];
$config->addConfiguration($arrayFromSomewhere);

//you can also use it like an array
$host = $config['database']['host'];
$host = $config['database/host'];

//throws an exception if a value is missing
$value = $config->get('missing/key');
```

When reading a config directory Conphigure will (by default) organize the configuration in each file into a common root based on the file path.

For example, a directory /directory/config/ with:

- system.yml
- email.yml
- logging.yml
- subdirectory/something.yml

```
//read the directory
$config->read('/directory/config/');

//get all configuration as an array
$all = $config->all();
var_export($all);
/* The result will be:
[
    'system' => ['...'], //contents of system.yml
    'email' => ['...'], //contents of email.yml
    'logging' => ['...'], //contents of logging.yml
    'subdirectory' => [
        'something' => ['...'], //contents of subdirectory/something.yml
    ]
];
*/
```

This allows you to keep things organized, and keep each file very flat.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Michael O'Connell](https://github.com/thewunder)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance72

Regular maintenance activity

Popularity35

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity79

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 ~250 days

Recently: every ~535 days

Total

13

Last Release

160d ago

Major Versions

0.9.5 → 1.02017-10-04

1.1 → 2.02020-01-29

2.2 → 3.02023-12-01

PHP version history (4 changes)0.9.0PHP ~7.0

2.0PHP ~7.1

2.2PHP &gt;=7.4

3.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![thewunder](https://avatars.githubusercontent.com/u/1265740?v=4)](https://github.com/thewunder "thewunder (24 commits)")

---

Tags

jsonconfigurationSettingsconfigyamlini

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/thewunder-conphigure/health.svg)

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

###  Alternatives

[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

69124.2k1](/packages/m1-vars)

PHPackages © 2026

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