2017 © Pedro Peláez
 

package config

A config component catalogue.

image

websublime/config

A config component catalogue.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Websublime\Config

Build Status, (*1)

Syntax

Config component is a package based on Symfony Config where it is used as a catalogue of configurations. It can be inserted or just loading from two types of files: yml and php. We do not have made more supported files because it is this kind of files that we most use., (*2)

How To Use

First create an instance of which type of loader for the file you want to use., (*3)

$yaml = new YamlConfigLoader('/path/where/config/will/be');

Then create an instance of Config and set the loader resolver., (*4)

$config = new Config();
$config->setConfigResolver($yaml);

After, you have to import your configuration file., (*5)

$config->import('myconfig.yml');

The import method is void. The configuration is added to ConfigCatalogue were you can interact in Config. Lets say your config fil have:, (*6)

config:
    key: 'My new option'

When you import your configuration file it is registered in ConfigCatalogue with the name of your file without extension and if it is an array multidimensional it will be transformer in a flatten array. So to get our value from our config we call:, (*7)

$config->get('myconfig.config.key');

The methods present in ConfigCatalogue are:, (*8)

ConfigCatalogue->get($key);
ConfigCatalogue->add($value, $key=null);
ConfigCatalogue->remove($key);
ConfigCatalogue->exist($key);
ConfigCatalogue->all();

Of course it isn't mandatory to use a file of configurations. You can use it without one. Just instantiate the Config and you are rock and load to use the ConfigueCatalogue methods., (*9)

Changelog

- Added version 0.2
- Added support for loading php files for configs
- Added methods getDelegateLoader() and getLoaderResolver() on ConfigResolver.

The Versions

14/03 2014

dev-master

9999999-dev https://github.com/websublime/config

A config component catalogue.

  Sources   Download

MIT

The Requires

 

component config catalogue

03/05 2013

dev-development

dev-development https://github.com/websublime/config

A config component catalogue.

  Sources   Download

MIT

The Requires

 

component config catalogue

03/05 2013

v0.1.0

0.1.0.0 https://github.com/websublime/config

A config componente catalogue.

  Sources   Download

MIT

The Requires

 

03/05 2013

v0.2.0

0.2.0.0 https://github.com/websublime/config

A config componente catalogue.

  Sources   Download

MIT

The Requires