Skip to content

skpr/php-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Config

CircleCI

A simple utility for reading skpr config from a directory, and populating environment variables in PHP applications.

The default skpr config directory is /etc/skpr

Usage

Loading config

$config = SkprConfig::create()->load();
$config->get('foo.bar');

Setting environment variables

You can optionally set environment variables from Skpr config.

$config = SkprConfig::create()->load();
$config->putAllEnvs();

Keys will be converted to uppercase, and dots are converted to underscores. For example:

getenv('FOO_BAR')

You can also provide a list of config keys, to avoid adding all config as environment variables:

$config = SkprConfig::create()->load();
$config->putEnvs(['my.key1', 'my.key2']);

Testing

Run tests using the following:

bin/phpunit

Code Standards

Run code style checks with the following:

bin/phpcs

About

Helper lib for using Skpr config in PHP applications.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages