2017 © Pedro Peláez
 

library conphigure

Framework Agnostic Configuration Library

image

thewunder/conphigure

Framework Agnostic Configuration Library

  • Thursday, November 30, 2017
  • by thewunder
  • Repository
  • 2 Watchers
  • 27 Stars
  • 1,188 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 25 % Grown

The README.md

Conphigure

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

Conphigure is a framework agnostic library for reading and retrieving configuration. If your application has outgrown a single configuration file this library will be a good choice., (*2)

It can read configuration files in the following formats:, (*3)

  • php
  • yaml
  • json
  • xml
  • ini
  • dotenv

Conphigure can also read entire directories containing configuration files., (*4)

Install

Via Composer, (*5)

``` bash $ composer require thewunder/conphigure, (*6)


## Usage If you have configuration in myfile.yml ``` yaml smtp: host: smtp.mycompany.com port: 25

Read it in your php application like the following, (*7)

``` php $config = Conphigure::create();, (*8)

//load configuration from a single file $config->read('/directory/myfile.yml');, (*9)

//get a value $port = $config->get('smtp/port');, (*10)

//add configuration from somewhere else (cache / database / etc) $arrayFromSomewhere = [ 'database' => [ 'host' => 'localhost' ] ]; $config->addConfiguration($arrayFromSomewhere);, (*11)

//you can also use it like an array $host = $config['database']['host']; $host = $config['database/host'];, (*12)

//throws an exception if a value is missing $value = $config->get('missing/key');, (*13)


When reading a config directory Conphigure will (by default) organize the configuration in each file into a common root based on the file path. For example, a directory /directory/config/ with: - system.yml - email.yml - logging.yml - subdirectory/something.yml ``` php //read the directory $config->read('/directory/config/'); //get all configuration as an array $all = $config->all(); var_export($all); /* The result will be: [ 'system' => ['...'], //contents of system.yml 'email' => ['...'], //contents of email.yml 'logging' => ['...'], //contents of logging.yml 'subdirectory' => [ 'something' => ['...'], //contents of subdirectory/something.yml ] ]; */

This allows you to keep things organized, and keep each file very flat., (*14)

Change log

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

Testing

bash $ composer test, (*16)

Contributing

Please see CONTRIBUTING for details., (*17)

Credits

License

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

The Versions

30/11 2017

dev-master

9999999-dev https://github.com/thewunder/conphigure

Framework Agnostic Configuration Library

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

30/11 2017

1.1

1.1.0.0 https://github.com/thewunder/conphigure

Framework Agnostic Configuration Library

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

04/10 2017

1.0

1.0.0.0 https://github.com/thewunder/conphigure

Framework Agnostic Configuration Library

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

25/09 2017

0.9.5

0.9.5.0 https://github.com/thewunder/conphigure

Framework Agnostic Configuration Library

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

22/09 2017

0.9.4

0.9.4.0 https://github.com/thewunder/conphigure

Multi-source configuration manager

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

22/09 2017

0.9.3

0.9.3.0 https://github.com/thewunder/conphig

Multi-source configuration manager

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

21/09 2017

0.9.2

0.9.2.0 https://github.com/thewunder/conphig

Multi-source configuration manager

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

21/09 2017

0.9.1

0.9.1.0 https://github.com/thewunder/conphig

Multi-source configuration manager

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml

21/09 2017

0.9.0

0.9.0.0 https://github.com/thewunder/conphig

Multi-source configuration manager

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

settings json configuration ini config yaml