定制 skpr/config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

skpr/config

最新稳定版本:3.0.2

Composer 安装命令:

composer require skpr/config

包简介

Reads skipper configuration files.

README 文档

README

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

统计信息

  • 总下载量: 168.89k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-09-23