Search by

phramecms / routing

TLyngeJ

PSR-7 / PSR-15 HTTP routing, middleware dispatch, and structured error handling for PhrameCMS.

Package info

github.com/PhrameCMS/routing

pkg:composer/phramecms/routing

Statistics

Installs: 36

Dependents: 5

Suggesters: 2

Stars: 0

Open Issues: 0

v0.1.0 2026-12-04 21:04 UTC

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 RouteProviderInterface services, 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/core
  • psr/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.