PHPackages                             laurent22/konfig - 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. laurent22/konfig

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

laurent22/konfig
================

Simple configuration class with support for cascading file system.

1.0(12y ago)0144MITPHP

Since Feb 15Pushed 12y ago1 watchersCompare

[ Source](https://github.com/laurent22/konfig)[ Packagist](https://packagist.org/packages/laurent22/konfig)[ RSS](/packages/laurent22-konfig/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

konfig
======

[](#konfig)

Simple configuration class for PHP with support for cascading file system.

Installation
============

[](#installation)

Either copy the Konfig.php class or add this to `composer.json`:

```
 require {
 	"laurent22/konfig": "dev-master"
 }

```

Usage
=====

[](#usage)

Each config files is a simple PHP file that returns an associative array. For example:

```
return array(
	'host' => '127.0.0.1',
	'port' => '6543',
	'user' => 'dbadmin',
	'password' => '123456',
);

```

Assuming this kind of file structure:

```
config/
	dev/
		database.php
		default.php
	live/
		database.php
		default.php

```

The following can be used to load the config files:

```
// Always load the live environment
Konfig::addLookupFolder('config/live');

// But allow overriding the values if we are in development environment:
if (ENV == 'dev') Konfig::addLookupFolder('config/dev');

```

Then to access the values:

```
$dbHost = Konfig::get('database', 'host');

$fullDbConfig = Konfig::getGroup('database');

```

The relevant files are loaded only as needed (if they are not used, nothing gets loaded).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

4468d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/640707f47ddb176af96e5aa2a1960c16c579bae4ce9316abb67e8a8434373ab0?d=identicon)[lau22](/maintainers/lau22)

### Embed Badge

![Health badge](/badges/laurent22-konfig/health.svg)

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

PHPackages © 2026

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