2017 © Pedro PelĂĄez
 

library config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

image

masnathan/config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  • Tuesday, October 4, 2016
  • by MASNathan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 157 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

Config4all

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads Support via Gittip, (*1)

This class helps you load your application configs, it supports php, xml, ini, yml, neon and json files., (*2)

It's easy to use, and you can load multiple files with diferent formats at once, (*3)

Install

Via Composer, (*4)

``` bash $ composer require masnathan/config4all, (*5)


## Usage ``` php use MASNathan\Config\Config; $config = new Config(); //You can load as many files as you want, one by one $config->load('configs/config.php', 'configs/database.php'); //or all the files with a certain extension at the same time $config->load('configs/*.json'); //you can even load multiple format files at the same time $config->load('configs/*.json', 'configs/*.yml'); //or can also load multiple files, regardless of the extension $config->load('configs/*.*'); //This is how you clear all the configurations $config->clear();

Fetching the information

//To get a value, you just need to know the path to get there
//if you want to know my name, just use the get method and pass the configuration file name
//and the keys to get my name, like this
echo $config->get('config', 'me', 'name');

//here are some other examples
echo $config->get('config', 'github');
echo $config->get('database', 'host');

//if the value that you are trying to get doesn't exist, you'll get a null
//you can also get the entire structure by calling the method get with no arguments
var_dump($config->get());

Setting my own configs

//You can also set new configs on the fly, or change existing ones
$config
    ->set('a', 'b', 'c', 'value')
    ->set('config', 'me', 'name', 'Not Andre Filipe')
    ->set('database', 'host', 'first', 'localhost')
    ->set('database', 'host', 'second', 'somehost')
    ->set('this is a null field');

//This will return 'value'
echo $config->set('a', 'b', 'c');

Change log

Please see CHANGELOG for more information what has changed recently., (*6)

Testing

bash $ composer test, (*7)

Contributing

Please see CONTRIBUTING for details., (*8)

Security

If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

04/10 2016

dev-master

9999999-dev https://github.com/MASNathan/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

The Development Requires

php json xml config yaml neon

04/10 2016

2.2.0

2.2.0.0 https://github.com/MASNathan/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

The Development Requires

php json xml config yaml neon

25/06 2015

2.1.1

2.1.1.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

php json xml ini config

17/02 2015

2.1.0

2.1.0.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

php json xml ini config

09/03 2014

2.0.0

2.0.0.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

php json xml ini config

09/03 2014

2.0.1

2.0.1.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

 

php json xml ini config

28/02 2014

1.0.1

1.0.1.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

php json xml ini config

04/10 2013

1.0.0

1.0.0.0 https://github.com/ReiDuKuduro/Config4all

This class helps you load your application configs, it supports php, xml, ini and json files.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

php json xml ini config