bravo3/properties
最新稳定版本:1.0.2
Composer 安装命令:
composer require bravo3/properties
包简介
YAML property loader
关键字:
README 文档
README
This property loader is designed for unit testing and uses the singleton design pattern to achieve this. Consider a dependency injection container if you wanted a property loader for the main application.
Usage
Conf::init('/path');
$c = Conf::getInstance();
$property = $c['some.property'];
or simply -
Conf::init('/path');
$property = Conf::get('some.property');
Defaults can be used here too -
$property = Conf::get('some.property', 'default value');
Config File
The path in the init line should point to where the properties.yml file should be, if the properties.yml file isn't
present, it will look for a properties.yml.dist file. You can change the properties filename with the init functions
second parameter.
Properties
YAML arrays are delimited in the property key using periods.
properties.yml:
some:
property: hello world
Code:
echo Conf::get('some.property'); // hello world
统计信息
- 总下载量: 7.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-05-26