案例效果来源:github :https://github.com/madalinoprea/magneto-debug
此存储库代表Magento 1.x的扩展,它提供了开发人员调试工具栏。这个想法来自robhudson的django-debug-toolbar。最新版本基于Symfony的WebProfilerBundle UI。
![å·¥å
·æ ](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/frontend_toolbar_request.png)
特征
- 请求和控制器信息:列出处理请求的请求属性和控制器; 捕获Ajax和POST请求的请求信息
- 执行时间线:显示基于Varien Profiler计时器的执行时间线
- 日志:显示在请求期间添加到系统和例外日志的日志行
- 事件:显示在请求和被调用的观察者期间调度的所有事件
- 数据库:列出请求期间加载的所有模型和集合; 启用SQL事件探查器时,列出所有执行的SQL查询,并提供查看其结果或描述其执行计划的功能
- 电子邮件:列出已发送预览的电子邮件
- 布局:输出渲染树,列出当前请求期间加载的布局处理程序,并添加查看布局文件添加到特定句柄的更新的功能; 提供有关实例化和渲染块的信息
- 配置:列出可用的Magento模块及其状态和版本; 还提供启用/禁用它们的功能
- 工具栏工具:包含快速链接以刷新缓存,启用模板提示,启用SQL事件探查器,启用Varien Profiler,启用Magento Enterprise全页缓存调试
效果图如下所示:
Toolbar In Frontend
![Toolbar](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/frontend_toolbar_request.png)
Configuration Panel from Admin
![Configuration Panel from Admin](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/admin_toolbar_tools.png)
Request Profile Grid
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_grid.png)
Request, Response & Session
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_request.png)
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_response.png)
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_session_config.png)
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_404.png)
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_post_ajax.png)
Performance
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_timeline.png)
Events
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_post_events.png)
Database
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_ajax_database.png)
E-mails
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_post_emails.png)
Layout
![](https://github.com/madalinoprea/magneto-debug/raw/master/docs/images/view_layout_rendering_tree.png)