drmvc / config
项目配置操作库
3.0.5
2018-03-30 16:32 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ~6.0
README
DrMVC\Config
用于操作项目配置的库。
composer require drmvc/config
如何使用
<?php require_once __DIR__ . '/../vendor/autoload.php'; // Config object $config = new \DrMVC\Config(); // Load file with array inside from filesystem $config->load(__DIR__ . '/array.php'); // Load file from filesystem and put into array with specific key $config->load(__DIR__ . '/array.php', 'subarray'); $config->set('param_new', 'value'); // Add new text parameter $config->set('param_arr', [1,2,3]); // Add new array parameter $all = $config->get(); // Get all available parameters $one = $config->get('param_new'); // Get single parameter $arr = $config->get('param_arr'); // Get single parameter with array
更多示例,请参考这里。
关于PHP单元测试
首先需要通过composer update
安装所有开发依赖,然后可以通过在源目录下运行./vendor/bin/phpunit
命令来手动运行测试。