You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most collectors can receive data only through their event listeners. A host that has other data sources, or no events manager, cannot feed them. Add public methods to these collectors. Behavior does not change.
Current state
ExceptionsCollector::addThrowable() already exists and does not change.
DatabaseCollector, ViewCollector, RouteCollector and CacheCollector write their data only inside subscribe() closures.
Proposed direction
Follow the addThrowable() naming. The existing listeners call the new methods.
DatabaseCollector: a start method and a finish method that takes the SQL and the bindings. The collector measures the time.
ViewCollector: a start method that takes the path and a finish method. The pending stack stays, so nested partials are timed correctly.
CacheCollector: a method that takes the operation and the key.
RouteCollector: a method that takes the panel values, or a callable that returns them. The collector calls the callable at collect time. This keeps the MVC read at collect time, because the MVC router is not fully resolved when router:matchedRoute fires. After [NFR]: Move MVC event names from collectors to an MVC bridge #15, the collector needs no Phalcon\Mvc import.
Acceptance
Each collector gets data through its new method, with no events manager.
The existing collector tests pass with the same expected results.
Tests pass with full coverage. phpcs and phpstan pass.
Activity
niden commentedon Nov 3, 2026
Resolved in #52