shazam/easy-config
最新稳定版本:0.3.1
Composer 安装命令:
composer require shazam/easy-config
包简介
Reads Yaml config files
README 文档
README
Simple PHP library to read from yaml files.
Usage
Place the following code in the constructor of your class or the superclass:
use EasyConfig\Config; $config = Config::getInstance(); $config->setUseCache(false); //Default is true, so no need to specify if you want to use APC $config->loadConfig( array( __DIR__ . '/../config/environment.yml', __DIR__ . '/../config/properties.yml' ) );
Somewhere else in your code you can load a config value, by calling $config->fetch() and the headings of the value:
$config = Config::getInstance();
$var = $config->fetch('heading', 'subheading'); //Fetches value under [heading][subheading]
$var = $config->fetch('heading', 'subheading', 'subheading'); //Fetches value under [heading][subheading][subheading]
$var = $config->fetch(); //Fetches the whole config
You can specify as many keys as you want when fetching config values.
统计信息
- 总下载量: 590
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2014-11-24