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

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

kris-ro/php-config
==================

Setup, getter and setter for configuration in PHP applications

v1.0.4(1mo ago)2282MITPHPPHP 8.\*

Since Aug 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kris-ro/php-config)[ Packagist](https://packagist.org/packages/kris-ro/php-config)[ RSS](/packages/kris-ro-php-config/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (6)Used By (2)

PHP App Configuration Class
===========================

[](#php-app-configuration-class)

PHP class for managing configuration throughout an application.

Installation
------------

[](#installation)

Use composer to install *PHP Config*.

```
composer require kris-ro/php-config
```

Usage
-----

[](#usage)

```
require YOUR_PATH . '/vendor/autoload.php';

use KrisRo\PhpConfig\Config;

# static call
# providing a path (optional) to a folder here will load all json files in the folder
Config::buildConfig('/absolute/path/to/your/folder/with/json/files');

// magic call for debug and salt entries in the config array
Config::debug();
Config::salt();

// setter call
// set method returns the new value
Config::set('database/username', 'k2'); # returns 'k2'

Config::get('database/username'); # returns 'k2'
```

### Initialize as object

[](#initialize-as-object)

```
// path here is also optional; if provided all json files in that folder will be loaded
new Config('/absolute/path/to/your/folder/with/json/files');

$this->assertEquals('k2', Config::set('database/username', 'k2'));
// verify new value
$this->assertEquals('k2', Config::get('database/username'));
```

### Load json files in specific order

[](#load-json-files-in-specific-order)

```
(new Config())
      ->loadConfigFile(/absolut/path/to/first.json')
      ->loadConfigFile(/absolut/path/to/second.json')
      ->loadConfigFile(/absolut/path/to/nth.json');

(new Config())
      ->setConfigPath('/absolute/path/to/your/folder/with/json/files')
      ->loadConfigFile(first-file-to-load.json')
      ->loadConfigFile(second-file-to-load.json')
      ->loadConfigFile(nth-file-to-load.json');
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

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

Total

5

Last Release

32d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56273996?v=4)[kris-ro](/maintainers/kris-ro)[@kris-ro](https://github.com/kris-ro)

---

Top Contributors

[![kris-ro](https://avatars.githubusercontent.com/u/56273996?v=4)](https://github.com/kris-ro "kris-ro (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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