bogosoft / configuration
PHP 7.4+应用程序配置合约和最小实现
3.0.0
2019-12-20 00:40 UTC
Requires
- php: >=7.4
- bogosoft/core: ^2
Requires (Dev)
- phpunit/phpunit: ^8.5
README
这个库包含处理应用程序配置的合约和实现。
要求
- PHP 7.4+
bogosoft/core
安装
composer require bogosoft/configuration
用法
# # Start with an array of values. # $values = [ 'database:customers:host' => 'db.example.com', 'database:customers:password' => '12345', 'database:customers:port' => '3306', 'database:customers:username' => 'root' ]; # # Convert the array into a configuration. # $config = new Bogosoft\Configuration\SimpleConfiguration($values); # # Values can be access from the configuration as if it were an array. # $port = $config->get('database:customers:port'); // Returns, '3306'.