Repository navigation
Closed
Closed
Feature
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The debug bar can only be booted and injected against a Phalcon\Mvc\Application. This blocks non-MVC applications, notably ADR (Phalcon\ADR). #39 and #40 add the neutral core. This issue adds the ADR integration, so that an ADR app can boot the bar and inject it into an HTML response.
Why ADR does not work today
- The ADR container is
Phalcon\Container\Container. It is not aPhalcon\Di\DiInterface. - ADR never fires
application:beforeSendResponse. The response is available atapplication:afterHandle(Phalcon\ADR\Application), and the ADR emitter writes it out after that.
Proposed direction
- Add an ADR service provider that implements
Phalcon\Contracts\Container\Service\Provider. It:- reads the events manager and the request from the container
- boots the neutral core
- attaches the response step to
application:afterHandle
- Use a service provider because
AbstractHttpFront::boot()callsregisterProviders()beforerun()callsgetApplication(). The integration has the container at that point, but not the application. - Register this provider last, after all other providers, and document this. The provider resolves the events manager and the request during registration. After that point,
extend()on these services throwsCannotExtendResolved, andset()has no effect. - Update the requirements in
docs/index.md:13and thesuggestentry incomposer.json. ADR support needs Phalconv5.18.0or later, or Phalcon 6. - Do not add an emitter hook.
AbstractHttpFront::run()emits afterhandle()returns, and the existing listener already works onapplication:afterHandle. - Keep ADR class references in the provider only, not in the core. Phalcon versions before
v5.18.0have noPhalcon\ADR. - Only
Phalcon\Events\ManagerInterfaceis supported. A custom manager that implements onlyPhalcon\Contracts\Events\Managerdoes not work withSubscriber::subscribe(). - Update
docs/index.md:38, which says that the provider takes the MVC application. Add a non-MVC section that also shows a host with no events manager. - Add a changelog entry.
Out of scope
- History. See [NFR]: Serve request history in ADR apps #43
- Data collection. Panels that need MVC events stay empty until [NFR]: ADR bridge and DataMapper database source #16, [NFR]: ADR route source #45, [NFR]: ADR view and cache panels #46 and [NFR]: ADR exceptions source #47.
Known limit
Phalcon\ADR\Application::handle() supports a reused request in a long-lived worker. Collectors have no reset method, so in a worker their data grows from request to request. HistoryCookie::fromGlobals() also reads only at boot. This issue supports one request for each process. Document this limit.
Acceptance
- The bar boots and injects into an HTML
ResponseInterfacein an application that has neither aPhalcon\Mvc\Applicationnor aPhalcon\Di\DiInterface. - The bar is not injected into a JSON response.
- The bar does not boot in a blocked environment.
- The existing MVC integration (as used by
phalcon/vokuro) is unchanged. - Tests pass with full coverage.
phpcsandphpstanpass. - The documentation states the minimum versions, the provider order and the worker limit.
Depends on
Part of
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
- StatusShow more project fieldsImplemented
Activity
niden commentedon Nov 3, 2026
Resolved in #51