2017 © Pedro Peláez
 

library config

A flexible configuration file loader that supports multiple file formats

image

slince/config

A flexible configuration file loader that supports multiple file formats

  • Friday, May 26, 2017
  • by slince
  • Repository
  • 1 Watchers
  • 4 Stars
  • 493 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 41 % Grown

The README.md

Configuration File Loader

Build Status Coverage Status Latest Stable Version Scrutinizer, (*1)

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., (*2)

Installation

Install via composer, (*3)

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

Usage

Creates a config instance

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

Load configuration files

Loads a configuration file, (*4)

$config->load('/path/to/config.json');

Loads a directory that contains multiple files, (*5)

$config->load('/path/to/config-directory/');

Notes: The directory can't contain unsupported files., (*6)

Access data

$config->get('foo');

//Or access the data like array
$config['foo']['bar'];

Checks whether a item exists by its key, (*7)

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

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

Adds a item to the container, (*8)

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

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

Removes a item by its key, (*9)

$config->delete('bar');

//or like array
unset($config['bar']);

Removes all items, (*10)

$config->clear();

Dumps all items to an specified configuration file

$config->dump('/path/to/config-dump.php');

License

The MIT license. See MIT, (*11)

The Versions

26/05 2017

dev-master

9999999-dev

A flexible configuration file loader that supports multiple file formats

  Sources   Download

MIT Apache-2.0

The Requires

  • php >=5.5.9

 

The Development Requires

by tao

php json xml configuration ini config yaml yml

07/05 2017

1.1.0

1.1.0.0

A flexible configuration file loader that supports multiple file formats

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by tao

php json xml configuration ini config yaml yml

06/07 2016

1.0.0

1.0.0.0

Slince config component

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.9

 

The Development Requires

by tao