Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Request history works only in MVC. Make it work in ADR apps, with no change to the application routes.
Why ADR needs a different mechanism
- MVC selects the controller on
application:beforeHandleRequest. ADR does not fire this event, and it has no MVC dispatcher. - A listener on
application:beforeHandlecannot stophandle(). - A listener on
application:afterHandleruns after the application routing and the error responder. This is too late.
Proposed direction
- Add a package ADR Action (
Phalcon\Contracts\ADR\Action) that calls the handler from [NFR]: Extract a neutral history handler from HistoryController #42. - Decorate
Phalcon\Contracts\ADR\Router\Routerthroughextend()on the container:- The history URL returns
new RouterMatch($actionClass). - All other URLs go to the inner router.
- The decorator implements all 9 contract methods and forwards them to the inner router, including the 4 setters that
Application::handle()calls.Phalcon\ADR\Router\Routerisfinal, so a subclass is not possible.
- The history URL returns
- The ADR service provider from [NFR]: Framework-neutral integration seam: boot and response injection without Mvc\Application #14 registers history when
history.enabledis set. It also registers the Action in the container with its dependencies. - The existing
HistoryEndpoint::matches()guard stops injection on the history response.
Notes
- Global middleware also runs for this Action. For example,
phalcon/vokuro-adrhasRememberMeLogin. - The history URL replaces an application route with the same path, as it does in MVC. [NFR]: History Panel enhancements #32 tracks this.
- A probe confirmed the decorator for
GETandDELETEon the history URL, and for other URLs. - The router
extend()must run before the container resolves the router, becauseextend()on a resolved service throwsCannotExtendResolved. The application must not resolve the router during registration.
Acceptance
- An ADR app can list, read and clear history.
- The history panel shows in an ADR app.
- A denied client gets a 404 from the history URL.
- Other URLs reach the application routes with no change.
- History in
phalcon/vokurostill works. - Tests pass with full coverage.
phpcsandphpstanpass.
Depends on
- [NFR]: Framework-neutral integration seam: boot and response injection without Mvc\Application #14
- Slice 4 [NFR]: Remove DI and MVC types from HistoryEndpoint #41
- Slice 5 [NFR]: Extract a neutral history handler from HistoryController #42
Part of
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
- StatusShow more project fieldsImplemented
Activity
niden commentedon Nov 5, 2026
Resolved in #59