A flexible configuration file loader that supports multiple file formats

1.1.0 2017-05-07 08:23 UTC

This package is auto-updated.

Last update: 2024-02-08 16:39:03 UTC


Build Status Coverage Status Latest Stable Version Scrutinizer

The library support multiple configuration file formats like json,ini,xml,yaml and native php array. It can also help to dump items to the specified configuration file.


Install via composer

    "require": {
        "slince/config": "^1.0"


Creates a config instance

$config = new Slince\Config\Config();

Load configuration files

Loads a configuration file


Loads a directory that contains multiple files


Notes: The directory can't contain unsupported files.

Access data


//Or access the data like array

Checks whether a item exists by its key

echo $config->exists('foo');

//or like array
echo isset($config['foo']);

Adds a item to the container

$config->set('bar', 'baz');

//or like array
$config['bar'] = 'baz';

Removes a item by its key


//or like array

Removes all items


Dumps all items to an specified configuration file



The MIT license. See MIT