[NFR]: Show the debug page in ADR apps
维护者通常 1 天内回复
@niden 已经在做这个了。
开始于 2026年11月3日。
评估
这个 Issue 还没有评估数据。
描述
Summary
The package gives two things: the debug bar and the debug page (Phalcon\Debug). The debug page does not show in an ADR app, because ADR catches all exceptions before the debug page handler can run. Show the debug page in ADR apps, in development only.
Current state
Debug::listen()usesset_exception_handler()(src/Debug.php:178).Phalcon\ADR\Application::handle()catches eachThrowableand sends it toErrorResponder.AbstractHttpFront::run()also catches eachThrowable. The handler does not run for these exceptions.Debug::halt()throwsRequestHalted(src/Debug.php:147), andonUncaughtLowSeverity()throwsRuntimeWarning(src/Debug.php:253). In an Action, these also go toErrorResponder, so the client gets a generic error response.ErrorResponderhas a debug mode that gives the exception to the client. It does not give the debug page (backtrace, code fragments and superglobals).
Proposed direction
- Use the logger adapter from #47 to get the exception.
- Add a listener on
application:afterHandle. When the logger received an exception, the response status is 500 or higher and the response is not JSON, the listener replaces the response content withDebug::renderHtml($exception). - Keep the status that
ErrorResponderset. A 404 fromRouteNotFoundkeeps the application error page. - The application opts in through a config key of the ADR service provider from #14.
- The listener runs only when the bar boots, and only for a client that
AccessGateallows. The debug page shows sensitive data.
Notes
This design is not tested yet. Test it first in this issue.
Acceptance
- In an ADR app in development, an exception in an Action shows the debug page.
Debug::halt()in an Action shows the debug page.- The debug page is absent in a blocked environment and for a denied client.
- The debug page does not replace a JSON response or a 404 response.
- The bar is not injected into the debug page.
- The public API of
Phalcon\Debugdoes not change. - Tests pass with full coverage.
phpcsandphpstanpass.
Depends on
- #14
- #47
Part of
#13
- 主要语言
- PHP
- 星标
- 6
- 派生
- 3
- 平均合并
- 3 小时 31 分钟
- 30 天内合并 PR
- 43
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phalcon/debugbar 的其他 Issue
-
[BUG]: Duplicated JS and CSS for the exceptions and logs panels可能已有人在做 @niden 于 1 天前认领。 未关闭bug
phalcon/debugbar#108 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BUG]: The last exception differs between MVC and ADR可能已有人在做 @niden 于 1 天前认领。 未关闭bug
phalcon/debugbar#107 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BUG]: Small fixes for IP match, accessibility and docblocks可能已有人在做 @niden 于 1 天前认领。 未关闭bug
phalcon/debugbar#106 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BUG]: Member order and function imports do not follow the coding rule可能已有人在做 @niden 于 1 天前认领。 未关闭bug
phalcon/debugbar#105 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BUG]: CI does not test a Phalcon 5 only install or the minimum version可能已有人在做 @niden 于 1 天前认领。 未关闭bug
phalcon/debugbar#104 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
opnsense/core#11171 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
getgrav/grav-plugin-form#664 ·
-
claude
难度 2/5 1-3 小时 新手友好度 82/100
sprain/sprainocchio#26 ·
-
sync-en
难度 1/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复