PHPackages                             r3pt1s/configlib - 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. r3pt1s/configlib

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

r3pt1s/configlib
================

Dynamic config library

301PHP

Since Jan 10Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/r3pt1s/configlib)[ Packagist](https://packagist.org/packages/r3pt1s/configlib)[ RSS](/packages/r3pt1s-configlib/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

configlib
=========

[](#configlib)

Dynamic config library

Example
=======

[](#example)

(JSON) Config-Class
-------------------

[](#json-config-class)

```
class TestConfig extends Configuration {

    /** @ignored Will not be saved */
    private string $configName = "TEST";
    private string $where = "Unknown";
    private string $who = "Unknown";
    private array $extraData = [
        "age" => -1
    ];

    public function __construct() {
        parent::__construct(__DIR__ . DIRECTORY_SEPARATOR . "test.json", 1);
    }

    public function setWhere(string $where): void {
        $this->where = $where;
    }

    public function setWho(string $who): void {
        $this->who = $who;
    }

    public function setExtraData(array $extraData): void {
        $this->extraData = $extraData;
    }

    public function getWho(): string {
        return $this->who;
    }

    public function getConfigName(): string {
        return $this->configName;
    }

    public function getWhere(): string {
        return $this->where;
    }

    public function getExtraData(): array {
        return $this->extraData;
    }
}
```

(YAML) Config-Class
-------------------

[](#yaml-config-class)

```
class YAMLTestConfig extends Configuration {

    /**
     * @comment whats good lil bro
     * @comment this comment thingy only works for yaml tho remember that
     */
    private array $testArray = [
        "test" => "hi",
        "data" => ["db" => "root"]
    ];

    public function getTestArray(): array {
        return $this->testArray;
    }
}
```

Main
----

[](#main)

```
$cfg = new TestConfig();
if (!$cfg->load()) $cfg->save(); // First save with default values
var_dump($cfg->getWhere()); // Outputs: First time: Unknown | Second time: Germany
var_dump($cfg->getWho()); // Outputs: First time: Unknown | Second time: r3pt1s
var_dump($cfg->getExtraData()); // Outputs: First time: Unknown | Second time: 14
$cfg->setWhere("Germany"); // Set the value of $where to "Germany"
$cfg->setWho("r3pt1s"); // Set the value of $who to "r3pt1s"
$cfg->setExtraData(["age" => 17]); // Set the value of $extraData to ["age" => 14]
$cfg->save(); // Saves the config with the current
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance52

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/698c28d5f2cf3878c7452f4024d1f25901ccf42bb03b05e4eb10e661199df525?d=identicon)[r3pt1s](/maintainers/r3pt1s)

---

Top Contributors

[![r3pt1s](https://avatars.githubusercontent.com/u/54471820?v=4)](https://github.com/r3pt1s "r3pt1s (21 commits)")[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (1 commits)")

### Embed Badge

![Health badge](/badges/r3pt1s-configlib/health.svg)

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

PHPackages © 2026

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