2017 © Pedro Peláez
 

library properties

YAML property loader

image

bravo3/properties

YAML property loader

  • Wednesday, December 2, 2015
  • by jordonsc
  • Repository
  • 5 Watchers
  • 0 Stars
  • 6,602 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

YAML Property Loader

This property loader is designed for unit testing and uses the singleton design pattern to achieve this. Consider a dependency injection container if you wanted a property loader for the main application., (*1)

Usage

Conf::init('/path');
$c = Conf::getInstance();
$property = $c['some.property'];

or simply -, (*2)

Conf::init('/path');
$property = Conf::get('some.property');

Defaults can be used here too -, (*3)

$property = Conf::get('some.property', 'default value');

Config File

The path in the init line should point to where the properties.yml file should be, if the properties.yml file isn't present, it will look for a properties.yml.dist file. You can change the properties filename with the init functions second parameter., (*4)

Properties

YAML arrays are delimited in the property key using periods., (*5)

properties.yml:, (*6)

some:
    property: hello world

Code:, (*7)

echo Conf::get('some.property');   // hello world

The Versions

02/12 2015

dev-master

9999999-dev

YAML property loader

  Sources   Download

MIT

The Requires

 

The Development Requires

config properties

02/12 2015

1.0.2

1.0.2.0

YAML property loader

  Sources   Download

MIT

The Requires

 

The Development Requires

config properties

29/01 2015

1.0.1

1.0.1.0

YAML property loader

  Sources   Download

MIT

The Requires

 

The Development Requires

config properties

29/01 2015

dev-bugfix/compatiblity-for-symfony-yml-2.6up

dev-bugfix/compatiblity-for-symfony-yml-2.6up

YAML property loader

  Sources   Download

MIT

The Requires

 

The Development Requires

config properties

26/05 2014

1.0.0

1.0.0.0

YAML property loader

  Sources   Download

MIT

The Requires

 

The Development Requires

config properties