phalcon / phalcon/debugbar

[NFR]: Decouple collectors from framework event names (bridge + canonical signals)

Open
#15 0 comments 0 reactions 1 assignee View on GitHub

@niden is already working on this.

Since Jul 22, 2026.

enhancement
Dominant language
PHP
Stars
5
Forks
3
Avg merge
2d 23h
Merged PRs (30d)
3

Description

Summary

Collectors gather data by subscribing to MVC-specific event names, so nothing collects under ADR or any non-MVC stack. Introduce a neutral seam - a canonical debug-bar signal set, a per-framework bridge, and a direct push API - so collectors receive data regardless of the host application's event vocabulary, or the absence of one.

Current coupling

Collectors call subscribe(ManagerInterface $eventsManager) and attach to framework event names:

  • DatabaseCollectordb:beforeQuery, db:afterQuery
  • ViewCollectorview:beforeRenderView, view:afterRenderView
  • RouteCollectorrouter:matchedRoute
  • ExceptionsCollectordispatch:beforeException
  • CacheCollector → cache events

These names are emitted by the MVC stack. ADR fires a different vocabulary (APPLICATION_*, ADR_*, PIPELINE_*), and some hosts have no events manager at all.

Proposed direction (three layers)
  1. Canonical signal set owned by the bar - a small, stable vocabulary (query, view.rendered, route.matched, request.received, response.sending). Collectors subscribe only to these.
  2. Per-framework bridge that maps native signals to canonical ones. The MVC bridge listens to db:afterQuery / view:* / router:matchedRoute and re-emits canonical signals (current behavior, refactored behind the bridge). The ADR bridge listens to PIPELINE_* / APPLICATION_*, or instruments directly where no matching event exists.
  3. Direct push API on collectors (e.g. record(...)) for hosts with no events manager - the bridge pushes directly.

The events manager becomes an implementation detail of the active bridge, not a hard dependency of the collectors.

Acceptance
  • A collector receives data through the canonical signals with no reference to a framework-specific event name.
  • The MVC bridge preserves current behavior (as used by phalcon/vokuro), verified by the existing tests.
  • A collector can be fed with no events manager present (push API).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.