定制 glueful/extension-contracts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

glueful/extension-contracts

Composer 安装命令:

composer require glueful/extension-contracts

包简介

Shared cross-extension contracts for the Glueful ecosystem: tenancy, payment, and email-template seams.

README 文档

README

Shared cross-extension contracts for the Glueful ecosystem. This package is intentionally small: interfaces, readonly value objects, and constants only.

Soft Binding Rule

Only implementers bind shared contract IDs in the container. Consumers resolve a contract with has() ? get() : <inline fallback> and never bind defaults under a shared contract ID. That avoids boot-order and last-wins container surprises.

Tenancy

CurrentTenantResolver::tenantUuid() returns the active tenant UUID or ''. The empty string is a valid single-store sentinel only when the consuming extension is not running in tenant mode. In tenant mode, a bound resolver returning '' means missing tenant context and the consumer must fail closed unless it is running an explicitly named system/maintenance path.

TenantTableRegistry lets tenant-aware extensions register tenant-owned tables without writing into another extension's config.

Payments

PaymentCollector starts a payment for a PayableReference and must be idempotent per (type, id): repeated calls return or refresh the same logical intent.

PaymentConfirmationHandler is the provider-to-owner seam. Payment providers dispatch verified successful payments only, with PaymentConfirmation::amount in integer minor units. The payable owner still compares amount and currency against its own record before transitioning business state.

Email

EmailTemplateRegistry lets any extension declare mail templates as data — EmailTemplateDefinition (key, label, default subject/body, owner) with EmailTemplatePlaceholder metadata (name, description, sample) that drives admin chips and test-sends. Implementations must enforce the collision rule: re-registering a key is allowed only for the same owner; a different owner claiming an existing key throws at boot. Registrant extensions soft-resolve the registry (has() ? register : skip), so a missing email channel degrades to "templates simply aren't registered".

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固