Download the PHP package tsaotai/tsaotai-pro without Composer
On this page you can find all versions of the php package tsaotai/tsaotai-pro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tsaotai-pro
TsaoTai Pro(后端 PHP)
版本:2026.1.12 · 日期:2026-09-07
Composer:tsaotai/tsaotai-pro
命名空间:tsaotai\pro\
源码:github.com/tsaotai/tsaotai-pro
对齐:tsaotai/tsaotai-addons
ThinkPHP 8 上的配置中后台引擎:资源定义 + Gateway 分发 + Table/Form/Grid 后端能力。
不是插件壳;不替代 addons、登录、ACL、主题。
前端另见产品仓 packages/tsaotai-pro(运行时 TsaoTai.table / form / grid)。
发版细则:PACKAGING.md。
提供 / 不提供
| 提供 | 不提供 |
|---|---|
ProResource::define 与 meta / capabilities |
业务 *Resource.php |
ProGateway 动作分发 |
/api/pro/... 路由(宿主声明) |
| list / get / save / delete / dic / batch / reorder | CSRF、captcha、Session 登录实现 |
导入导出 + ProTask |
前端 JS |
| Grid SSRM | 应用中心 / 租户勾选 |
ProHost + Contracts;Think Service 只 boot Host |
脚手架 CLI |
安装
Think 发现 extra.think.services → tsaotai\pro\Service:
- 加载包内
config.php→config('tsaotai_pro') ProHost::bootFromConfig(...)(auto_boot_host => false可关)- 不自动挂路由
宿主最小接入
1. 路由
2. 控制器实现 Responder
可选 proUser(): ?array 供限流 / 审计。
3. 业务资源
约定路径:{addons_root}/{plugin}/pro/{Name}Resource.php
4. 注入 Host(推荐)
包默认 auditor = noop;无 root_path() 时必须配置 addons_path。
能力与动作
| capabilities | 动作 |
|---|---|
core(默认) |
list get save delete dic meta |
batch |
batch(delete 须 captcha) |
reorder |
reorder |
import-export |
export import template |
grid-ssrm |
grid / rows |
异步任务下载 HMAC:配置 tsaotai_pro.download_secret(或宿主 common.app_key / app.app_key / common.app_id)。无密钥则拒绝签发 token。
配置 tsaotai_pro
| 键 | 默认 | 说明 |
|---|---|---|
auto_boot_host |
true |
Service 是否自动 boot |
addons_path |
'' |
空则 root_path()/addons;再无则抛错 |
runtime_path |
'' |
空则 runtime_path() |
rate_limit_export |
10 |
导出每用户每分钟 |
download_secret |
'' |
下载 HMAC;空则回退其它键 |
安全模型(宿主责任)
- 鉴权 / CSRF / captcha:宿主控制器
- 行级权限:Resource
hooks.authorize/scopeQuery - 多库:Resource
db闭包;默认Db::connect() - Gateway 对外异常:过滤 SQL/堆栈特征,其余短业务文案放行
plugin名仅[\w\-]+,并校验 realpath 不逃出 addons 根
目录
从旧命名迁移
| 旧 | 新 |
|---|---|
tsaotai/pro |
tsaotai/tsaotai-pro |
TsaoTai\Pro\* |
tsaotai\pro\{Resource,Http,Query,Io}\* |
无 class_alias。
测试
License
Apache-2.0