yuhari / config
此包最新版本(1.1.1)没有提供许可证信息。
php config utils,提供环境选择、节点扩展等...
1.1.1
2017-12-22 08:04 UTC
This package is not auto-updated.
Last update: 2024-09-18 03:50:08 UTC
README
配置读写工具
邮箱: yuhari@126.com
###安装
- git
git clone https://github.com/yuhari/helper-config.git
- composer
composer require yuhari/config
示例用法
<?php
/**
*
*
* @author yuhari
* @version $Id$
* @copyright , 27 September, 2017
* @package default
*/
/**
* Test Case
*/
include_once '../vendor/autoload.php' ;
//initial
\config\Factory::init(__DIR__ . '/conf/', 'dev') ;
//you can get all options by character '*' .
$c = \config\Factory::get('example.*') ;
print_r($c) ;
//you can get a specified value.
$c = \config\Factory::get('example.tip') ;
print_r($c) ;
//you may also achieve target as this
$c = \config\Factory::get('example', 'tip') ;
print_r($c) ;
//you can set a value
\config\Factory::set('example.tip', 'dev mode') ;
$c = \config\Factory::get('example.tip') ;
print_r($c) ;
\config\Factory::set('env.welcome' , 'Hello, world!') ;
$c = \config\Factory::get('env.welcome') ;
print_r($c) ;