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

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

wandu/config
============

Simple Config Based On Dot Array.

v3.0.4(9y ago)02.4kMITPHPPHP &gt;=5.6

Since May 26Pushed 8y agoCompare

[ Source](https://github.com/Wandu/Config)[ Packagist](https://packagist.org/packages/wandu/config)[ RSS](/packages/wandu-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (16)Used By (0)

Wandu Config
============

[](#wandu-config)

[![Latest Stable Version](https://camo.githubusercontent.com/8c044e5a5d01b3a69eb116fd3e34dcee8f954520601bf09d7b8d1922eb326de5/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6e6669672f762f737461626c652e737667)](https://packagist.org/packages/wandu/config)[![Latest Unstable Version](https://camo.githubusercontent.com/66073359e455a440a9e18ea60f5a12c4a6b570adfbb3af2f9d729a5eb4d4d5ba/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6e6669672f762f756e737461626c652e737667)](https://packagist.org/packages/wandu/config)[![Total Downloads](https://camo.githubusercontent.com/c6d719efd4c134be272ded0763537ace46e9aeed06b0095e37c907175e040cd3/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6e6669672f646f776e6c6f6164732e737667)](https://packagist.org/packages/wandu/config)[![License](https://camo.githubusercontent.com/9fad1adf5cdc115fe38eb340c3aa0425fb6e9a6015666e1b7005ec664012617d/68747470733a2f2f706f7365722e707567782e6f72672f77616e64752f636f6e6669672f6c6963656e73652e737667)](https://packagist.org/packages/wandu/config)

Simple Config Based On Dot Array.

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

[](#installation)

```
composer require wandu/config
```

Usage
-----

[](#usage)

```
$config = new \Wandu\Config\Config([
    'host' => 'wandu.github.io',
    'log' => [
        'handler' => 'monolog',
        'path' => 'log/wandu.log',
    ],
]);

static::assertSame('wandu.github.io', $config->get('host'));
static::assertSame('wandu.github.io', $config['host']);

static::assertSame([
    'handler' => 'monolog',
    'path' => 'log/wandu.log',
], $config->get('log'));
static::assertSame([
    'handler' => 'monolog',
    'path' => 'log/wandu.log',
], $config['log']);

static::assertSame('log/wandu.log', $config->get('log.path'));
static::assertSame('log/wandu.log', $config['log']['path']);
static::assertSame('log/wandu.log', $config['log.path']); // you can use dot syntax in array!
```

### Use Default Value

[](#use-default-value)

```
$config = new \Wandu\Config\Config([
    'debug' => false,
    'cache_dir' => null,
]);

static::assertSame(false, $config['debug']);
static::assertSame(null, $config['cache_dir']);
static::assertSame(null, $config['unknown']);

static::assertSame(false, $config->get('debug', true));
static::assertSame(null, $config->get('cache_dir', "/")); // check by array_key_exists
static::assertSame("unknown text..", $config->get('unknown', "unknown text.."));
```

### Support Loader

[](#support-loader)

- PHP (example, [test\_php.php](../../../tests/Config/test_php.php))
- JSON (example, [test\_json.json](../../../tests/Config/test_json.json))
- Env(require `m1/env`) (example, [test\_env.env](../../../tests/Config/test_env.env))
- YAML(require `symfony/yaml`) (example, [test\_yml.yml](../../../tests/Config/test_yml.yml))

```
$config = new \Wandu\Config\Config();

$config->pushLoader(new \Wandu\Config\Loader\PhpLoader());
$config->pushLoader(new \Wandu\Config\Loader\JsonLoader());
$config->pushLoader(new \Wandu\Config\Loader\EnvLoader());
$config->pushLoader(new \Wandu\Config\Loader\YmlLoader());
$config->pushLoader(new \Wandu\Config\Loader\PathLoader([
    new \Wandu\Config\Loader\YmlLoader(),
]));

$config->load(__DIR__ . '/test_php.php');
$config->load(__DIR__ . '/test_json.json');
$config->load(__DIR__ . '/test_env.env');
$config->load(__DIR__ . '/test_yml.yml');
$config->load(__DIR__ . '/test_path');

static::assertSame([
    'foo' => 'foo string',
    'vendor1' => [
        'service1' => [
            'name' => 'vendor1 service1 name..',
            'path' => 'vendor1 service1 path..',
        ],
        'service2' => [
            'name' => 'vendor1 service2 name..',
            'path' => 'vendor1 service2 path..',
        ],
    ],
    'vendor2' => [
        'service1' => [
            'name' => 'vendor2 service1 name..',
            'path' => 'vendor2 service1 path..',
        ],
        'service2' => [
            'name' => 'vendor2 service2 name..',
            'path' => 'vendor2 service2 path..',
        ],
    ],
    'json1' => 'json 1 string',
    'json2' => [
        'json2-1',
        'json2-2',
    ],
    'env1' => 'what the',
    'env2' => false,
    'yml1' => [
        'yml11' => true,
    ],
    'yml2' => [
        'paths' => ['vendor/*', 'tests/*']
    ],
    'yml3' => [
        'yml3_1',
        'yml3_2',
    ],
    'app' => [
        'debug' => true,
        'env' => 'test',
    ],
], $config->toArray());
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity66

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

Every ~34 days

Recently: every ~72 days

Total

14

Last Release

3247d ago

Major Versions

v3.0.4 → v4.0.0-beta12017-06-08

PHP version history (3 changes)v3.0.0-beta1PHP &gt;=7.0.0

v3.0.0-beta5PHP &gt;=5.6

v4.0.0-beta1PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b499bc2a487ec730542759876340fb439fe2474ea14f2105ca88f003717d495?d=identicon)[wan2land](/maintainers/wan2land)

### Embed Badge

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

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

###  Alternatives

[jeremykenedy/slack-laravel

Laravel integration for the jeremykenedy/slack package, including facades and service providers.

54757.5k](/packages/jeremykenedy-slack-laravel)

PHPackages © 2026

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