kasseler/config
最新稳定版本:1.0.1
Composer 安装命令:
composer require kasseler/config
包简介
Configure files library
README 文档
README
Config Component is a file configuration loader and saver that supports PHP, XML, JSON, and YAML files.
Requirements
- PHP >= 5.4
- symfony/yaml
Installation
$ composer require kasseler/config
Usage
Initialization Yaml configuration
$config = new Repository(new YamlFileReader(), new YamlFileWriter(), __DIR__.'/app/config/');
Initialization XML configuration
$config = new Repository(new XmlFileReader(), new XmlFileWriter(), __DIR__.'/app/config/');
Initialization JSON configuration
$config = new Repository(new JsonFileReader(), new JsonFileWriter(), __DIR__.'/app/config/');
Initialization PHP array configuration
$config = new Repository(new ArrayFileReader(), new ArrayFileWriter(), __DIR__.'/app/config/'); $config ->set('database.host', 'localhost') ->set('database.user', 'root') ->set('database.password', '') ->set('database.database', 'config') ->write(); $config->get('database.host');
统计信息
- 总下载量: 82
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-07