bsfp / config
dev-master
2018-11-11 23:54 UTC
Requires
- ext-json: *
- symfony/yaml: ^4.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-12 12:21:14 UTC
README
API
配置
new \BSFP\C(__DIR__ . '/path/to/configFolder');
检索您的配置
\BSFP\C::get('filename');
使用一层文件夹和 YAML 及 Json 文件。
演示
config/hello.json
{ "what": "world" }
index.php
<?php new \BSFP\C(__DIR__ . '/config'); echo 'Hello ' . \BSFP\C::get('hello')->get('what');
结果
php index.php
Hello world
运行测试
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests