PHPackages                             v-dem/queasy-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. [Framework](/categories/framework)
4. /
5. v-dem/queasy-config

ActiveLibrary[Framework](/categories/framework)

v-dem/queasy-config
===================

Configuration classes (currently supports PHP, INI, XML and JSON configs), part of QuEasy PHP Framework

v1.1.2(7mo ago)4432[10 issues](https://github.com/v-dem/queasy-config/issues)LGPL-3.0-onlyPHPPHP &gt;=5.3.0|&gt;=7.0.0

Since Sep 2Pushed 7mo ago1 watchersCompare

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

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

[![Codacy Badge](https://camo.githubusercontent.com/9113aba202254613acc9907db74d474051e4bac5862ab293ebf1762cdc492c68/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3832643835363235623331353465353461663038383339346432383564366335)](https://app.codacy.com/manual/v-dem/queasy-config?utm_source=github.com&utm_medium=referral&utm_content=v-dem/queasy-config&utm_campaign=Badge_Grade_Dashboard)[![Build Status](https://camo.githubusercontent.com/6948b3583b35c4155a26d4a4aae59110b17b87dd23d898ebffd25cf08d0f8c48/68747470733a2f2f7472617669732d63692e636f6d2f762d64656d2f7175656173792d636f6e6669672e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/v-dem/queasy-config)[![codecov](https://camo.githubusercontent.com/f5470fd3fe78c6d4fa1186a353d98409ae69ffd69dcf3094712229c50978b503/68747470733a2f2f636f6465636f762e696f2f67682f762d64656d2f7175656173792d636f6e6669672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/v-dem/queasy-config)[![Mutation testing badge](https://camo.githubusercontent.com/8173708339db333590ffdc6763e171cb2b7d855abd9d3805866335f7e932ca94/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246762d64656d2532467175656173792d636f6e6669672532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/v-dem/queasy-config/master)[![Total Downloads](https://camo.githubusercontent.com/653ebc816080e20c1ca995885b2dbc6fef2f0bc9f608ec88c11170821d89a959/68747470733a2f2f706f7365722e707567782e6f72672f762d64656d2f7175656173792d636f6e6669672f646f776e6c6f616473)](https://packagist.org/packages/v-dem/queasy-config)[![License](https://camo.githubusercontent.com/38f4821a4386d8e58bf8f65bad196576b2553783705a6d78e4a5dc22db408667/68747470733a2f2f706f7365722e707567782e6f72672f762d64656d2f7175656173792d636f6e6669672f6c6963656e7365)](https://packagist.org/packages/v-dem/queasy-config)

[QuEasy PHP Framework](https://github.com/v-dem/queasy-framework/) - Configuration
==================================================================================

[](#queasy-php-framework---configuration)

Package `v-dem/queasy-config`
-----------------------------

[](#package-v-demqueasy-config)

This package contains a set of the classes intended for reading configuration files. Formats currently supported are:

- PHP
- INI
- JSON
- XML
- CLI (command-line)

### Features

[](#features)

- Easy to use - just like nested arrays or objects. Also it's possible to use `foreach()` with config instances.
- Support for default option values.
- Support for multi-file configurations. You can split your config into many files as you wish without changing program code.
- Options inheritance. If an option is missing at current config level, it will look for this option on upper levels.
- Unified config interface. You can switch between config formats without changing your code.
- Easy to extend with other config formats.
- Regular expressions support (it's possible to get config options by regular expression).

### Requirements

[](#requirements)

- PHP version 5.3 or higher

### Reference

[](#reference)

See [Wiki page](https://github.com/v-dem/queasy-config/wiki).

### Installation

[](#installation)

```
> composer require v-dem/queasy-config:master-dev

```

### Usage

[](#usage)

Let's imagine we have the following `config.php`:

```
return [
    'connection' => [
        'driver' => 'mysql',
        'host' => 'localhost',
        'name' => 'test',
        'user' => 'root',
        'password' => 'secret'
    ]
];
```

Or `config.ini`:

```
[connection]
driver = mysql
host = localhost
name = test
user = root
password = secret
```

Or `config.json`:

```
{
    "connection": {
        "driver": "mysql",
        "host": "localhost",
        "name": "test",
        "user": "root",
        "password": "secret"
    }
}
```

Or `config.xml`:

```
