phramecms / routing
PSR-7 / PSR-15 HTTP routing, middleware dispatch, and structured error handling for PhrameCMS.
v0.1.0
2026-12-04 21:04 UTC
Requires
- php: ^8.5
- nyholm/psr7: ^1.8
- phramecms/core: ^0.1
- psr/http-factory: ^1.0
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- infection/infection: ^0.35.12
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- spaze/phpstan-disallowed-calls: ^4.15
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-04 21:35:25 UTC
README
PSR-7 / PSR-15 HTTP kernel, routing, and middleware pipeline module for PhrameCMS.
Responsibilities
- Route Registry & Matcher: Declarative route registration via tagged
RouteProviderInterfaceservices, supporting HTTP methods, typed path parameters (/api/v1/content/{entity_type}/{bundle}/{id}), route names, and rich metadata (required permissions, OpenAPI tags, rate-limit class). - PSR-15 Middleware Pipeline: Global and per-route middleware stacks for authentication, CORS, content negotiation, request correlation IDs, and caching.
- Structured Error Handling: Consistent RFC 9457 Problem Details (
application/problem+json) responses for validation errors, auth failures, 404/405 responses, and unhandled exceptions — giving API consumers and AI agents predictable, machine-readable diagnostics. - HTTP Kernel Entrypoint: Clean request-to-response dispatch decoupled from web SAPI globals so routes can be tested in-process without a web server.
Explicitly Out of Scope
- Headless CMS endpoint generation or OpenAPI serialization (see
phramecms/api) - Authentication or RBAC policy evaluation (provided as middleware by
phramecms/user) - HTML templating or frontend rendering
Dependencies
- PHP
^8.5 phramecms/corepsr/http-message,psr/http-server-handler,psr/http-server-middleware
Ecosystem
Part of the PhrameCMS multi-repo suite. See PhrameCMS/cms for the starter distribution and architecture docs.