2017 © Pedro Peláez
 

library config

A Config Implementation of our config PSR recommendation

image

conformity/config

A Config Implementation of our config PSR recommendation

  • Friday, April 8, 2016
  • by leemason
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Config

A Config Implementation inspired by mrjgreen/config, (*1)

References:, (*2)

https://github.com/mrjgreen/config, (*3)

https://github.com/ecfectus/config-recommendation, (*4)

Example file structure:, (*5)

config
|
|____ production
|        |
|        |_______ server1
|        |       |___ redis.php
|        |       |___ database.php
|        |
|        |_______ server2
|        |       |___ database.php
|        |
|        |_______ database.php
|
|____ app.php
|____ database.php
|____ redis.php

Example usage, (*6)

$environment = '';

$config = new Ecfectus\Config\Repository(new Ecfectus\Config\FileLoader(__DIR__ . '/config'), $environment);

var_dump($config['database']);
/*
array(
   'config_value' => 'foo',
   'config_value2' => 'bar'
);
*/

//________________________________________________________________________

$environment = 'production.server1';

$config = new Ecfectus\Config\Repository(new Ecfectus\Config\FileLoader(__DIR__ . '/config'), $environment);

var_dump($config['database']);
/*
array(
   'config_value' => 'baz',
   'config_value2' => 'bar',
   'new_config_only_for_server1' => 'boo',
);
*/

The Versions

08/04 2016

dev-master

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

A Config Implementation of our config PSR recommendation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar leemason