phpnomad/array-json-config
最新稳定版本:1.0.0
Composer 安装命令:
composer require phpnomad/array-json-config
包简介
README 文档
README
phpnomad/array-json-config provides two concrete strategies for phpnomad/config: an in-memory array-backed ConfigStrategy and a JSON file loader that implements ConfigFileLoaderStrategy. This package is just the strategy classes. If you want them wired into a DI container and registered at bootstrap, use phpnomad/json-config-integration, which depends on this package.
Installation
composer require phpnomad/array-json-config
In most PHPNomad applications you install phpnomad/json-config-integration instead, which pulls this package in as a dependency.
Overview
ArrayConfigStrategyimplementsPHPNomad\Config\Interfaces\ConfigStrategy. It holds registered configuration data in a protected array and exposesregister(),has(), andget()methods. Lookups support dot notation viaPHPNomad\Utils\Helpers\Arr::dot(), soget('database.default.host')walks nested arrays.JsonFileLoaderimplementsPHPNomad\Config\Interfaces\ConfigFileLoaderStrategy. ItsloadFileConfigs()method reads a path, runsjson_decode(), and throwsPHPNomad\Config\Exceptions\ConfigExceptionif the file cannot be parsed into an array.- Both classes live under the
PHPNomad\ArrayJsonConfig\Strategiesnamespace. - Any code that depends on the
phpnomad/configinterfaces can consume these strategies without modification. - Pair with
phpnomad/json-config-integrationto bind the strategies to the DI container and register configs againstConfigServiceat load time.
Documentation
Full documentation for PHPNomad lives at phpnomad.com.
License
MIT. See LICENSE.txt.
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-18