PHPackages                             lawondyss/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. lawondyss/config

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

lawondyss/config
================

Base class for creating own class of configuration. Better than a associative array :-)

2.0.2(2y ago)32.5k1MITPHPPHP &gt;=8.0

Since Jun 3Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/Lawondyss/Config)[ Packagist](https://packagist.org/packages/lawondyss/config)[ RSS](/packages/lawondyss-config/feed)WikiDiscussions main Synced 6d ago

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

Config
======

[](#config)

Base class for creating own class of configuration. Better than a associative array :-)

Install
-------

[](#install)

Over [Composer](https://getcomposer.org/)

```
composer require lawondyss/config
```

Usage
-----

[](#usage)

```
class DbConfig extend Lawondyss\Config
{
  public string $driver;
  public string $host;
  public string $database;
  public string $username;
  public string $password;
  public string $charset;
}

$dbConfig = DbConfig::fromArray([
  'driver' => 'mysqli',
  'host' => 'localhost',
  'database' => 'example',
  'username' => 'root',
  'password' => 'root',
  'charset' => 'utf8'
]);
```

Simple get and set individual option.

```
$charset = $dbConfig->charset;
$dbConfig->charset = 'latin1';
```

Is implemented array access.

```
$pass = $dbConfig['password'];
$dbConfig['password'] = '*****';
```

If you want default values, then defined in class.

```
class DbConfig extend Lawondyss\Config
{
  public string $driver = 'mysqli';
  public string $host = 'localhost';
  public string $database;
  public string $username;
  public string $password;
  public string $charset = 'utf8';
}

$defaultConfig = new DbConfig;
```

Is possible "merge" with a customized options.

```
$lipsumDbConfig = $defaultConfig->withOptions([
  'database' => 'lipsum',
  'username' => 'lorem',
  'password' => 'ipsum',
]);
```

If another code use options as associative array:

```
$dibi = new Dibi\Connection($lipsumDbConfig->toArray());
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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

Total

3

Last Release

917d ago

Major Versions

1.0 → 2.0.02023-11-11

PHP version history (2 changes)1.0PHP &gt;=7.1

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f642f8a219fdaad6b73c302bfc3a623148b8eefd58ea4078cdfae1f24c47fc5?d=identicon)[Lawondyss](/maintainers/Lawondyss)

---

Top Contributors

[![Lawondyss](https://avatars.githubusercontent.com/u/272130?v=4)](https://github.com/Lawondyss "Lawondyss (6 commits)")

---

Tags

configconfigurationphpphp-libraryphp8

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lawondyss-config/health.svg)

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

###  Alternatives

[dvizh/yii2-cart

yii2-cart it's a simple cart module to collect application models, that implement cart interface + widgets

204.5k](/packages/dvizh-yii2-cart)

PHPackages © 2026

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