Issue Feature Under Review Quiet

#111178Dispatch Extbase actions through a configurable PSR-15 middleware stack

Alexander Schnitzler 10/20/26, 15:20 updated 11/04/26, 10:01

Description

Extbase offers no way to wrap the dispatching of a controller action. BeforeActionCallEvent and AfterRequestDispatchedEvent allow code before and after, but not around it: no try/finally around the action, no timing across exceptions (e.g. tracing/APM such as Sentry spans), no short-circuit with an own response. Today this requires an own controller base class or XCLASS.

Proposal: Mvc\Dispatcher runs each action (once per pass of the forward loop) through a PSR-15 middleware stack named “extbase”. Middlewares are registered in Configuration/RequestMiddlewares.php like the “frontend”/“backend” stacks (before/after/disabled, ordered and cached by MiddlewareStackResolver) and executed by Core\Http\MiddlewareDispatcher. The kernel resolves the controller and calls processRequest(). Core registers no middleware in this stack, so behaviour without third-party middlewares is unchanged. No change to ActionController or ControllerInterface.

The inner stack around the action invocation (#[Authorize], #[RateLimit]) follows in a separate change, see the related issue.

Reviews 2

History 16