2017 © Pedro Peláez
 

library config

Webiny Config Component

image

webiny/config

Webiny Config Component

  • Friday, September 29, 2017
  • by SvenAlHamad
  • Repository
  • 2 Watchers
  • 0 Stars
  • 499 Installations
  • PHP
  • 19 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 23 Versions
  • 7 % Grown

The README.md

Config Component

Config component creates ConfigObject instances from config files. Currently supported formats: INI, JSON, PHP, YAML and custom drivers., (*1)

Install the component

The best way to install the component is using Composer., (*2)

composer require webiny/config

For additional versions of the package, visit the Packagist page., (*3)

Usage

To use Config component you will need a config file., (*4)

Example INI:, (*5)

[properties]
a = "value"
b.name = "name"
b.value = "value"

Here is an example of creating a ConfigObject:, (*6)

    $config = \Webiny\Components\Config\Config::getInstance()->ini('path/to/file.ini');

This will result in $config object containing the following properties:, (*7)

    $config->properties->a = 'value';
    $config->properties->b->name = 'name';
    $config->properties->b->value = 'value';

If you don't want to use INI sections, or set custom nest delimiter, specify the following arguments:, (*8)

    $config = \Webiny\Components\Config\Config::getInstance()->ini('path/to/file.ini', false, '_');

You can get your config as string in any format using the following methods:, (*9)

    $string = $config->getAsJson();
    $string = $config->getAsPhp();
    $string = $config->getAsIni($useSections = true, $nestDelimiter = '.');
    $string = $config->getAsYaml($indent = 4);

And you can also use custom driver, (*10)

    $driverInstance = new MyCustomDriver();
    $string = $config->getAs($driverInstance);

You can also merge one config with another ConfigObject or array:, (*11)

$config->mergeWith($config2);

Resources

To run unit tests, you need to use the following command:, (*12)

$ cd path/to/Webiny/Component/Config/
$ composer.phar install
$ phpunit

The Versions

29/09 2017

dev-master

9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

29/09 2017

1.6.x-dev

1.6.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

29/09 2017

v1.6.0

1.6.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

29/09 2017

v1.6.1

1.6.1.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

08/09 2017

1.5.x-dev

1.5.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

08/09 2017

v1.5.0

1.5.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

21/08 2016

1.4.x-dev

1.4.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

21/08 2016

v1.4.3

1.4.3.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2016

v1.4.0

1.4.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2016

v1.4.1

1.4.1.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2016

v1.4.2

1.4.2.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

16/03 2015

1.3.x-dev

1.3.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

16/03 2015

v1.3.0

1.3.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

12/02 2015

1.1.x-dev

1.1.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

05/02 2015

v1.2.2

1.2.2.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

05/02 2015

v1.2.3

1.2.3.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2015

1.2.x-dev

1.2.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2015

v1.2.0

1.2.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

04/02 2015

v1.2.1

1.2.1.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

28/11 2014

v1.1.1

1.1.1.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

23/11 2014

v1.1.0

1.1.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

20/09 2014

1.0.x-dev

1.0.9999999.9999999-dev http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml

20/09 2014

v1.0.0

1.0.0.0 http://www.webiny.com/

Webiny Config Component

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sven Al Hamad
by Pavel Denisjuk

ini config yaml