milpa/core
Composer 安装命令:
composer require milpa/core
包简介
Milpa Framework — core contracts and primitives. Framework-agnostic: no ORM, no HTTP client, no host-application coupling (ADR-001).
README 文档
README
The framework-agnostic core of Milpa — a modular, AI-native PHP framework. Siembra módulos, cosecha aplicaciones.
milpa/core is the dependency-light heart of the Milpa framework: the attributes,
events, value objects, enums, interfaces, and the verification seam that every Milpa
module builds on. No Doctrine, no HTTP client, no product coupling — just the
contracts and primitives, so you can depend on them from anywhere.
Install
composer require milpa/core
Requirements
- PHP ≥ 8.3
Quick example
Value objects are immutable and self-validating. For instance, SemanticVersion:
use Milpa\app\ValueObjects\SemanticVersion; $v = SemanticVersion::parse('2.4.1'); $v->satisfies('^2.0'); // true $v->greaterThan(SemanticVersion::parse('2.4.0')); // true $v->incrementMinor(); // 2.5.0 (a new instance) $v->isStable(); // true — no pre-release tag
What's inside
| Namespace | What it provides |
|---|---|
Milpa\app\Attributes |
Declarative attributes (RegisterService, BusinessRule, Subscribe, …) |
Milpa\app\Events |
Framework event contracts + dispatch primitives |
Milpa\app\ValueObjects |
Immutable, validated values (SemanticVersion, capability & verification VOs, …) |
Milpa\app\Enums |
Shared enums (Roles, Events, …) |
Milpa\app\Interfaces |
Core contracts (MilpaEventDispatcherInterface, PluginManifestInterface, …) |
Milpa\app\Support |
Small framework-agnostic helpers |
Every public symbol carries a DocBlock — the API reference is generated straight from them.
Documentation
Full API reference: getmilpa.github.io/core — generated straight from the source DocBlocks and dressed with the Milpa design system.
Contributing
Contributions are welcome — see CONTRIBUTING.md. Please report security issues via SECURITY.md, and note that this project follows a Code of Conduct.
License
Apache-2.0 © the Milpa authors.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2026-07-05