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

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

nabeghe/chill-config
====================

Where carefree meets calm, and chill thrives in your PHP configuration.

v1.1.2(10mo ago)326MITPHPPHP ^8.2

Since Sep 30Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/nabeghe/chill-config-php)[ Packagist](https://packagist.org/packages/nabeghe/chill-config)[ Docs](https://github.com/nabeghe/chill-config)[ RSS](/packages/nabeghe-chill-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Chill Config for PHP
====================

[](#chill-config-for-php)

> Where carefree meets calm, and chill thrives in your PHP configuration.

Here's a simple library that helps you set up your project’s configuration. You pass in your options as an array, and then dynamically access them through object fields, methods or indexes. You can also define default values in a custom config class. Plus, you can organize different parts of your config as containers in custom classes and access those config options via static methods whenever you need them. This makes the default values load lazily.

🫡 Usage
-------

[](#-usage)

### 🚀 Installation

[](#-installation)

You can install the package via composer:

```
composer require nabeghe/chill-config
```

### Examples

[](#examples)

Check the examples folder in the repositiry.

- [Example 1: Simple Usage](examples/1-simple-usage.php)
- [Example 2: Defaults (deep merge)](examples/2-defaults-deep-merge.php)
- [Example 3: Defaults (no deep merge)](examples/3-defaults-no-deep-merge.php)
- [Example 4: Nested](examples/4-nested.php)
- [Example 5: Advanced Nested](examples/5-advanced-nested.php)
- [Example 6: Container](examples/6-container.php)

### Example 5: Advanced Nested

[](#example-5-advanced-nested)

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

use Nabeghe\ChillConfig\ChillConfig;

/**
 * Custom config class with defaults.
 *
 * IDE Helpers:
 *
 * @property ?string $name
 * @property ?string $type
 * @property ?string $license
 * @property ?string $version
 * @property ?string $autoload
 * @property ?DbConfig $db
 *
 * Get/Set:
 * @method void|string|null name(?string $value = 0)
 * @method void|string|null type(?string $value = 0)
 * @method void|string|null license(?string $value = 0)
 * @method void|string|null version(?string $value = 0)
 * @method void|array|null autoload(?array $value = 0)
 * @method void|DbConfig|null db(?DbConfig $value = 0)
 */
class Config extends ChillConfig
{
    public const DEFAULTS = [
        'type' => 'library',
        'license' => 'MIT',
        'version' => '1.1.0',
    ];

    public const NESTS = [
        'db' => DbConfig::class,
    ];
}

/**
 * Db config.
 *
 * IDE Helper:
 *
 * @property string|null $driver
 * @property string|null $host
 * @property string|null $name
 * @property string|null $user
 * @property string|null $password
 *
 * @method void|string|null driver(?string $value = 0)
 * @method void|string|null host(?string $value = 0)
 * @method void|string|null name(?string $value = 0)
 * @method void|string|null user(?string $value = 0)
 * @method void|string|null password(?string $value = 0)
 */
class DbConfig extends ChillConfig
{
    public const DEFAULTS = [
        'driver' => 'mysql',
        'host' => 'localhost',
    ];
}

$config = new Config([
    'name' => 'nabeghe/chill-config',
    'db' => [ // True turns into an empty array, false becomes null, and everything else (except null) gets converted into an array, whether it’s an object, JSON string, serialized data, etc.
        'name' => 'database',
        'user' => 'root',
        'password' => '0123456789',
    ],
]);

echo '>> Name: '.$config->name.PHP_EOL; // nabeghe/chill-config
echo '>> Type: '.$config->type.PHP_EOL; // library
echo '>> Version: '.$config->version.PHP_EOL; // 1.0.0
echo '>> Autoload: '.gettype($config->autoload).PHP_EOL; // NULL

echo "----------------------------------------------------------------------------------------------------\n";

echo '>> Database Driver: '.$config->db->driver.PHP_EOL; // NULL
echo '>> Database Host: '.$config->db->host.PHP_EOL; // NULL
echo '>> Database Name: '.$config->db->name.PHP_EOL; // NULL
echo '>> Database User: '.$config->db->user.PHP_EOL; // NULL
echo '>> Database Password: '.$config->db->password.PHP_EOL; // NULL
```

📖 License
---------

[](#-license)

Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance57

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

4

Last Release

310d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dae1bf378bcf40fe55c193160377d613d628188587554a3fb11cdec6f0521ba1?d=identicon)[nabeghe](/maintainers/nabeghe)

---

Top Contributors

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

---

Tags

configurationSettingsconfigoptionslibrary

### Embed Badge

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

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

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[dmishh/settings-bundle

Database centric Symfony configuration management. Global and per-user settings supported.

115254.9k1](/packages/dmishh-settings-bundle)[chillerlan/php-settings-container

A container class for immutable settings objects. Not a DI container.

3427.3M21](/packages/chillerlan-php-settings-container)[graste/params

Array wrapper that eases the retrieval of values. Has parameters, options and settings and traits for inclusion in other libraries.

107.0k](/packages/graste-params)

PHPackages © 2026

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