tailored-tunes/php-env-config
最新稳定版本:1.0.1
Composer 安装命令:
composer require tailored-tunes/php-env-config
包简介
A lightweight configuration management solution
关键字:
README 文档
README
A small config library for php that enables you to read environment variables, but override them with a config file too.
The reason behind this library is that we don't believe in stored configuration. Each environment is different, and code deployed to any machine might have completely different configurations. Therefore there's no sense in hardcoding anything. Nevertheless, during development it is painful to deal with environmental variables, so support for VCS ignored but easy to maintain file configuration was necessary.
Installation
Install via composer. Installation help and versions at Packagist
Usage
use TailoredTunes/Config; $config = new Configuration($_ENV, 'developer.ini'); $config->define('SOME_CONSTANT','defaultValue'); $configuredValue = $config->get('configName','defaultValue');
If developer.ini is present, the values found there will be taken. It is a good practice to add
developer.ini to the ignore list of your VCS, so all team members could have their own configurations
regardless of the main configuration.
统计信息
- 总下载量: 189
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-28