phpnomad/array-json-config 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpnomad/array-json-config

最新稳定版本:1.0.0

Composer 安装命令:

composer require phpnomad/array-json-config

包简介

README 文档

README

Latest Version Total Downloads PHP Version License

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

  • ArrayConfigStrategy implements PHPNomad\Config\Interfaces\ConfigStrategy. It holds registered configuration data in a protected array and exposes register(), has(), and get() methods. Lookups support dot notation via PHPNomad\Utils\Helpers\Arr::dot(), so get('database.default.host') walks nested arrays.
  • JsonFileLoader implements PHPNomad\Config\Interfaces\ConfigFileLoaderStrategy. Its loadFileConfigs() method reads a path, runs json_decode(), and throws PHPNomad\Config\Exceptions\ConfigException if the file cannot be parsed into an array.
  • Both classes live under the PHPNomad\ArrayJsonConfig\Strategies namespace.
  • Any code that depends on the phpnomad/config interfaces can consume these strategies without modification.
  • Pair with phpnomad/json-config-integration to bind the strategies to the DI container and register configs against ConfigService at load time.

Documentation

Full documentation for PHPNomad lives at phpnomad.com.

License

MIT. See LICENSE.txt.

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-18