PHPackages                             dtkahl/php-simple-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. dtkahl/php-simple-config

ActiveLibrary

dtkahl/php-simple-config
========================

1.2.0(8y ago)19.5k1MITPHPPHP &gt;=5.6.0

Since Apr 12Pushed 8y agoCompare

[ Source](https://github.com/dtkahl/php-simple-config)[ Packagist](https://packagist.org/packages/dtkahl/php-simple-config)[ RSS](/packages/dtkahl-php-simple-config/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/a42326221a09d663773f3c270c442f15193bb65fe9cefb46e7f22fa5fde8498a/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d73696d706c652d636f6e6669672f762f737461626c65)](https://packagist.org/packages/dtkahl/php-simple-config)[![License](https://camo.githubusercontent.com/28821cfc511d105b8e2b9aebe9a55f88430407d34c53e8c4ea9531063a59fb29/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d73696d706c652d636f6e6669672f6c6963656e7365)](https://packagist.org/packages/dtkahl/php-simple-config)[![Build Status](https://camo.githubusercontent.com/0e3d919d293a0887ee48f68622f66114b099e29274421851651d4a42e366a23a/68747470733a2f2f7472617669732d63692e6f72672f64746b61686c2f7068702d73696d706c652d636f6e6669672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dtkahl/php-simple-config)

PHP simple config
=================

[](#php-simple-config)

This is a simple config handler class with dot-syntax for PHP.

#### Dependencies

[](#dependencies)

- `PHP >= 5.6.0`

#### Installation

[](#installation)

Install with [Composer](http://getcomposer.org):

```
composer require dtkahl/php-simple-config

```

### Usage

[](#usage)

Refer namespace:

```
use Dtkahl\SimpleConfig\Config;

```

Create new Config instance:

```
$config = new Config([
    "database" => [
      "host" => "localhost",
      "port" => 1337,
      "username" => "developer",> 1337,
38
      "usernam
      "password" => "secret",
    ],
    "debug" => true,
    // ...
);
```

you can also load Config from file:

```
$config = new Config(require("./config.php"));
```

Example `config.php`:

```
