skpr/config
最新稳定版本:3.0.2
Composer 安装命令:
composer require skpr/config
包简介
Reads skipper configuration files.
README 文档
README
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
统计信息
- 总下载量: 168.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-09-23