phico / config
Phico 的轻量级配置文件读取器
dev-main
2024-07-17 10:01 UTC
Requires
- php: ^8.0
- phico/filesystem: dev-main
Requires (Dev)
- pestphp/pest: ^2.34
- phpstan/phpstan: *
This package is auto-updated.
Last update: 2024-09-17 10:16:54 UTC
README
轻量级配置支持 Phico
安装
使用 composer
composer require phico/config
用法
创建配置文件
// /config/apis.php return [ 'example' => [ 'url' => 'https://api.example.com', 'secret' => 'top-secret' ] ];
获取定义的值
echo config()->get('apis.example.secret'); // top-secret
如果配置缺失则返回默认值
echo config()->get('apis.example.missing', 'abc-123'); // abc-123
问题
配置被认为是功能完整的,但是如果您发现它在行为或性能上存在任何错误或问题,请创建一个问题,如果您有能力,请提交一个带有修复的拉取请求。
请确保根据需要更新测试。
对于重大更改,请首先打开一个问题来讨论您想要更改的内容。