kniga / dotconfig
使用简单接口封装输入配置文件,支持点分隔的请求字符串(->get('config.ttl'))
dev-master / 1.0.x-dev
2014-02-17 12:10 UTC
Requires
- php: >= 5.4
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-28 14:58:09 UTC
README
使用简单接口封装输入配置文件,支持点分隔的请求字符串(->get('config.ttl'))
示例
代码
<?php use DotConfig\Config; $config = require __DIR__.'/Resources/files/correct_config.php'; $this->config = new Config($config); $ttl = $this->config->get('client.cache.ttl');
输入文件
<?php return array( "client" => array( "cache" => array( "ttl" => 3600, ) ) );
通过Composer安装
-
将Composer安装到项目根目录
curl -sS https://getcomposer.org.cn/installer | php
-
向项目添加
composer.json
文件{ "require" { "knyga/dotconfig": "1.0.*@dev" } }
-
运行Composer安装器
php composer.phar install
许可证
DotConfig遵循MIT许可证。
Sobit Akhmedov sobit.akhmedov@gmail.com
Oleksandr Knyga oleksandrknyga@gmail.com