2017 © Pedro Peláez
 

library pop-config

Pop Config Component for Pop PHP Framework

image

popphp/pop-config

Pop Config Component for Pop PHP Framework

  • Monday, January 29, 2018
  • by nicksagona
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,144 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 5 % Grown

The README.md

pop-config

Build Status Coverage Status, (*1)

Join the chat at https://discord.gg/TZjgT74U7E, (*2)

Overview

pop-config is a basic configuration component that helps centralize application configuration values and parameters. Values can be accessed via array notation or object arrow notation. It can disable changes to the configuration values if need be for the life-cycle of the application. It also can parse configuration values from common formats, such as JSON, XML, INI and YAML., (*3)

pop-config is a component of the Pop PHP Framework., (*4)

Install

Install pop-config using Composer., (*5)

composer require popphp/pop-config

Or, require it in your composer.json file, (*6)

"require": {
    "popphp/pop-config" : "^4.0.3"
}

Top, (*7)

Quickstart

Set and access values

use Pop\Config\Config;

$config = new Config(['foo' => 'bar']);

$foo = $config->foo;
// OR
$foo = $config['foo'];

Allow changes

Changes to configuration values are disabled by default., (*8)

use Pop\Config\Config;

$config = new Config(['foo' => 'bar'], true);
$config->foo = 'New Value';

Merge new values into the config object

use Pop\Config\Config;

$config = new Config($configData);
$config->merge($newData);

Convert config object down to a basic array

use Pop\Config\Config;

$config = new Config($configData);
$data   = $config->toArray();

Parse a configuration file

; This is a sample configuration file config.ini
[foo]
bar = 1
baz = 2
use Pop\Config\Config;

$config = Config::createFromData('/path/to/config.ini');

// $value equals 1
$value = $config->foo->bar;

Render config data to a string format

Supported formats include PHP, JSON, XML, INI and YAML, (*9)

use Pop\Config\Config;

$config = new Config($configData);
echo $config->render('json');

Top, (*10)

The Versions

29/01 2018

v2.x-dev

2.9999999.9999999.9999999-dev http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

BSD-3-Clause New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration

29/01 2018

dev-master

9999999-dev http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

BSD-3-Clause New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

29/01 2018

dev-v3-dev

dev-v3-dev http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

BSD-3-Clause New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

29/01 2018

3.2.1

3.2.1.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

28/06 2017

3.2.0

3.2.0.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

26/06 2017

3.1.1

3.1.1.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

21/06 2017

3.1.0

3.1.0.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

22/02 2017

3.0.0

3.0.0.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.6.0

 

The Development Requires

php configuration config pop pop php app config application configuration

03/10 2016

2.1.1

2.1.1.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration

01/07 2016

2.1.0

2.1.0.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration

10/05 2016

2.0.0p2

2.0.0.0-patch2 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration

19/02 2016

2.0.0p1

2.0.0.0-patch1 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration

16/07 2015

2.0.0

2.0.0.0 http://www.popphp.org/

Pop Config Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php configuration config pop pop php app config application configuration