PHPackages                             achrome/conphig - 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. achrome/conphig

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

achrome/conphig
===============

A simple PHP Configuration manager

0.2.0(12y ago)132[1 issues](https://github.com/Achrome/Conphig/issues)MITPHPPHP &gt;=5.5.0

Since Jan 19Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Achrome/Conphig)[ Packagist](https://packagist.org/packages/achrome/conphig)[ Docs](http://github.com/Achrome/Conphig)[ RSS](/packages/achrome-conphig/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (3)Versions (3)Used By (0)

Welcome to Conphig
==================

[](#welcome-to-conphig)

It's a simple configuration generator that parses different types of configuration files into an object. The idea behind it is to standardize configuration objects and allowing you to mix and match configuration files as per need.

Currently the only supported file types are INI, XML and JSON. YAML support can be added through custom configuration

[![Build Status](https://camo.githubusercontent.com/f577f6739c7e1a5fb3a5deccf7d4ba80e8babff92eac8844579e83a92f4eb54a/68747470733a2f2f7472617669732d63692e6f72672f416368726f6d652f436f6e706869672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Achrome/Conphig)[![Coverage Status](https://camo.githubusercontent.com/1ea0dbe96a4ff1c441e996cafc5e3f27a41f21721a22403664d6ef77e5b63de8/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f416368726f6d652f436f6e706869672e737667)](https://coveralls.io/r/Achrome/Conphig)

### Installation

[](#installation)

#### With Composer

[](#with-composer)

Just add this to your `composer.json`

```
{
	"require": {
		"achrome/conphig": "*"
	}
}
```

Alternatively, you can use the composer CLI like this

```
$ php composer.phar require 'achrome/conphig=*'
```

Or

```
$ composer require 'achrome/conphig=*'
```

Then, in the application bootstrap, just `require 'vendor/autoload.php'`.

#### Without Composer (Honestly, why?)

[](#without-composer-honestly-why)

You can clone this repo directly and use it as well, like this

```
$ mkdir vendor && cd vendor
$ git clone https://github.com/Achrome/Conphig.git
```

Then, you just have to `require 'Conphig/autoload.php'` in the bootstrap file.

### Usage

[](#usage)

In the application bootstrap, `require 'Conphig/autoload.php'` to set up the autoloader, or if you are using Composer, just `require 'vendor/autoload.php'`

```
use Conphig\Factories\ConfigurationFactory;

$configCreator = new ConfigurationFactory;
$configuration = $configCreator->setConfigPath('/path/to/config/dir')
					       ->setConfigFileName('configFileName')
					       ->setConfigType('filetype')
					       ->create();
```

Or, if you prefer to go through a simpler route

```
use Conphig\Factories\ConfigurationFactory;

$configCreator = new ConfigurationFactory;
$configuration = $configCreator->create('/path/to/config/file.ext');
```

By default, it will take the file name `config` and type `ini`, so the only thing it needs is the path.

If this is the case, you could just do this.

```
use Conphig\Factories\ConfigurationFactory;

$configCreator = new ConfigurationFactory('/path/to/config/dir');
$configuration = $configCreator->create();
```

For example, if a config.ini looks like this,

```
[database]
engine = mysql
host = localhost
dbname = test
user = root
password = FooBar1234
```

When parsed through Conphig

```
use Conphig\Factories\ConfigurationFactory;

$configCreator = new ConfigurationFactory('/path/to/config/dir');
$configuration = $configCreator->create();

echo $configuration->database->engine; //Will output mysql
```

### Custom configurators

[](#custom-configurators)

You can register your own configuration system by extending `Conphig\Configurators\AbstractConfigurator` like this

```
namespace Foo;

use Conphig\Configurators\AbstractConfigurator;

class BarConfigurator extends AbstractConfigurator {

	public function parseConfig() {
		//The file name is saved in AbstractConfigurator::filePath and can be used here to write your own logic to parse the file.
		//Save the configuration in AbstractConfigurator::configuration for the factory to be able to return it.
	}
}
```

Then, you need to register the custom handler and it will be set as the configurator that will be used

```
use Conphig\Factories\ConfigurationFactory;

$configCreator = new ConfigurationFactory('/path/to/custom/config/dir');
$configuration = $configCreator->registerConfigHandler('custom', 'Foo\\BarConfigurator')->create();
```

### License

[](#license)

[MIT](https://github.com/Achrome/Conphig/LICENSE)

### Contributing

[](#contributing)

Just add new features as you want and send out a pull request! If you see an issue, just open it in [issues](https://github.com/Achrome/Conphig/issues)**Note**: Please run `grunt` before committing to make sure code style and unit tests pass

### Contact

[](#contact)

[Github](https://github.com/Achrome)[Mail](mailto:achromatic.rainbow@gmail.com)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~148 days

Total

2

Last Release

4397d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4629882?v=4)[Ashwin Mukhija](/maintainers/Achrome)[@achrome](https://github.com/achrome)

---

Top Contributors

[![achrome](https://avatars.githubusercontent.com/u/4629882?v=4)](https://github.com/achrome "achrome (63 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/achrome-conphig/health.svg)

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

PHPackages © 2026

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