polysource/core 问题修复 & 功能扩展

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

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

polysource/core

最新稳定版本:v0.1.2

Composer 安装命令:

composer require polysource/core

包简介

Polysource Admin — core contracts and value objects. Pure PHP, zero Symfony dependency.

README 文档

README

Core contracts and value objects for Polysource. Pure PHP 8.1+. Zero Symfony dependency.

The contract layer the rest of Polysource builds on — and the contract layer your extensions implement. 26 public types total. Coverage gate ≥ 90% (currently 99.17%).

The contracts

Tiny on purpose. If a contract grows past 5 methods we open an ADR (cf. ADR-010).

Contract Methods What it abstracts
DataSourceInterface 3 (search, find, count) Any read-only data source — Doctrine, Redis, Meilisearch, an HTTP API, your microservice
WritableDataSourceInterface extends + 3 (create, update, delete) Adds write — UI auto-detects and shows write affordances
BatchableDataSourceInterface extends + 1 (findMany) Avoids N+1 across resources
ResourceInterface 5 What a Polysource Resource is — name, label, fields, actions, data source
FieldInterface n/a (DTO + trait) A column declaration
ActionInterface 4 Base action contract (inline / bulk / global specialise)
InlineActionInterface extends Per-record action (button on each row)
BulkActionInterface extends Multi-record action (selection-driven)
FilterInterface n/a (DTO) A filter declaration
PermissionInterface 1 (isGranted) Plug your auth backend (Symfony default, OPA, LDAP, custom)
AdminPluginInterface 3 metadata Self-contained capability bundle (cf. ADR-018)

Value objects

All final with readonly properties. Mutations return new instances via with*() methods. Named exception: FieldTrait is a fluent mutable builder — never share a single field instance between two resources.

  • DataQuery — filters + sort + pagination + search text
  • DataPagelist<DataRecord> + optional total (null = unknown / cursor-based)
  • DataRecord — opaque id + payload
  • DataPayload — write-time payload
  • FilterCriterion(property, operator, values)
  • Pagination(offset, limit)
  • SortDirection — enum
  • ActionResult(outcome, message, data)success / failure / exception
  • AdminContext — request-scoped admin state
  • 17 more — see src/.

Install

composer require polysource/core

Requires PHP 8.1+ (cf. ADR-015).

Why "zero Symfony dependency"

You can use polysource/core in any PHP framework — Laravel, Slim, vanilla, anywhere. The Symfony wiring lives in polysource/symfony-bundle. The contracts here travel.

This is the line we won't cross: any PR adding a Symfony dependency to this package gets rejected on principle. See ADR-007 — PHP / Symfony version baseline.

Documentation

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固