Download the PHP package wiseadmin/wise-config without Composer

On this page you can find all versions of the php package wiseadmin/wise-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wise-config

wiseadmin/wise-config

ThinkPHP 6/8 键值对配置管理扩展包,提供配置存储、缓存管理、历史版本追踪、字典管理、多命名空间隔离、继承链解析、标签分类和后台管理界面

PHP Version ThinkPHP Packagist


✨ 特性

核心配置管理

字典管理(DictSDK)

高级特性


📦 安装

推荐包

初始化

执行数据库迁移

将创建 config、config_history、config_tag、dict_type、dict_item 五张数据表。


🚀 快速开始

ConfigManager(核心配置管理)

基础读写

使用 WiseConfig 门面:

命名空间与路径

支持冒号分隔的三段路径 namespace:group:key,以及链式调用指定 namespace:

继承链

支持多层级 namespace 的点分命名(如 project_a.plugin_mail.prod),子级可继承父级的配置:

设置配置时,通过 'inherit' => 0 可阻断继承,上级同名配置不会生效。

默认情况下 get() 只读取当前 namespace,只有 getResolved() 才走继承链。 如需让 get() 也统一走继承解析,可开启配置 wise-config.inheritance.apply_on_get = true(默认关闭,保持既有行为)。

标签管理

TP Config 桥接

将动态配置注入到 ThinkPHP 原生 config() 函数体系:

历史版本

缓存管理

字典管理(Facade,推荐)

WiseDictType / WiseDictItem 是 DictTypeService / DictItemService 的静态门面, 与 WiseConfig 风格一致,底层从容器解析服务实例:

完整方法列表见 facade/WiseDictType.php / facade/WiseDictItem.php 的 @method 注解。

DictSDK(兼容入口,容器未就绪时可用)

DictSDK 是早期的静态入口,聚合了类型 / 字典项 / 缓存三个服务,并内置 「容器不可用则自行 new」的兜底逻辑,因此可在安装器、迁移、CLI、单元测试等 DI 尚未注册的场景直接调用:

业务代码(容器已就绪)建议优先使用上面的 Facade;DictSDK 保留用于无容器场景与向后兼容。

字典项 CRUD(服务层)

支持的数据类型

类型标识 说明 存储格式 读取行为
text 单行文本 字符串 原样返回
number 数字 字符串 自动转为 int/float
html 富文本 HTML 字符串 返回 HTML(安全过滤后)
image 单图 相对路径 自动拼接完整 URL
json JSON 对象/数组 JSON 字符串 自动解析为数组

类型扩展

实现 wise\config\contract\TypeHandlerInterface 接口即可扩展自定义类型:

事件

配置事件

事件类 触发时机 关键参数
ConfigSaving 配置保存前 key, value, type, group, namespace
ConfigSaved 配置保存后 key, oldValue, newValue, type, group, namespace
ConfigDeleting 配置删除前 key, configId, group, namespace
ConfigReverted 配置回滚后 key, fromValue, toValue, historyId, namespace

字典事件

事件类 触发时机 关键参数
DictChangedEvent 字典项增删改时 dictCode, action(create/update/delete), data

其他事件

事件类 触发时机 说明
TagChanged 标签关联变更时 配置标签增删改
InheritanceBlocked 继承被阻断时 inherit=false 阻断上级继承

监听示例


⚙️ 配置

配置文件 config/wise-config.php:

权限配置示例


📂 目录结构


依赖关系

说明:本包仅提供服务层与数据模型,不含后台控制器/路由/视图。 后台管理界面(配置管理、字典管理)位于宿主应用的 app/admin/controller/WiseConfig*.php 与 app/admin/controller/WiseDict.php;配置中的 route_prefix 仅供宿主路由使用。

许可证

Apache-2.0


All versions of wise-config with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
topthink/framework Version ^8.0
topthink/think-migration Version ^3.0
wiseadmin/wise-support Version 1.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wiseadmin/wise-config contains the following files

Loading the files please wait ...