承接 ecocode/magento_profiler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ecocode/magento_profiler

Composer 安装命令:

composer require ecocode/magento_profiler

包简介

Web Profiler for Magento 1.x

README 文档

README

Build Status Coverage Status Code Climate SensioLabsInsight

The ecocode profiler provides a development toolbar for Magento which displays a wide range of metrics and page load data for all the pages of the shop. It gives you direct access to the page's database queries, memory usage, events, requests, layout rendering, translation resolution and many other useful statistics. It is also easily extendable if you need to track additional metrics.

This profiler is based on the awesome Symfony WebProfiler. The concept and code of the WebProfiler have been ported to assist with Magento as much as possible.

Requirements

  • php >= 5.5.9
  • magento < 2

Tested with magento 1.7, 1.8. 1.9

Demo Stores:

Toolbar

Profiler

More Images

Installation

Composer (recommended)

If you have not already configured magento-composer-installer add

"extra": {
   "magento-root-dir": "httpdocs/"
 }

to your composer.json. If your magento root dir is the same directory as the one containing your composer.json use "." as the magento-root-dir

composer require --dev ecocode/magento_profiler

Manually

Download the module and copy the app folder + "dev.php" into your magento root directory

If you install the module manually, it will miss some functionality until you install the dependencies. This is currently only possible via composer as we do need the composer autoloader.

To install the dependencies run the following from your magento root dir or a parent directory:

composer require --dev symfony/debug 3.0
composer require --dev symfony/stopwatch 3.2
composer require --dev symfony/yaml 3.1
composer require --dev jdorn/sql-formatter ~1.2
composer require --dev monolog/monolog 1.11

Magento Connect

ecocode Profiler

Webserver Config

It might be necessary to extend your webserver config to handle "dev.php" correctly. If your experiencing a 404 when you try to access "dev.php"

Nginx:

try adding the following to your nginx config before the php location definition:

location /dev.php/ {
    rewrite / /dev.php;
}

Apache:

nothing to do here, should run out of the box

Usage

The profiler is only enabled if you open your shop via http://myshop.local/dev.php/. The idea is to develop always in dev mode alias "dev.php" and only switch back to "production" from time to time to verify the result.

Features

  • Improved exception handling in dev mode with the symfony/debug. No more checking the log files!
  • Easily extendable, just add a new collector via your configuration

Collectors

  • Request/Response
    • Display of request/response server parameters
  • Memory
    • Display of memory usage
  • Time
    • New visualization of the varien profiler
  • Mysql
    • Display of all queries with syntax highlighting and stack traces to locate the origin
    • Queries by context so you can easily determine the origin block
    • Detection of identical queries that can be avoided
    • Metrics for "mysql crud" operations
    • Support for multiple database connections
  • Events
    • Display of all events that have been fired during page load
    • List of all called observers
  • Ajax
    • Recording of ajax calls
  • Customer
    • Display of customer group and tax class
  • Layout
    • Metrics including created and rendered blocks and total rendering time
    • List of layout handlers used
    • List of blocks created but not rendered
    • Call graph including rendering times by block, including and excluding children
  • Translations
    • Display of translations that are defined, missing, invalid or are using a fallback
  • Rewrites
    • Detection of rewrites and rewrite conflicts (credits to magen98-magerun for the detection)
  • Logs
    • Display of all Mage::log calls
  • Models
    • Display of all model load, delete and save calls
    • Detection of "load" calls within loops!
  • Cache
    • Display of current cache configuration including the option to enable/disable and flush from the profiler
    • Display of all cache calls including not-for-cache hits and misses
  • Configuration
    • Base PHP configuration
    • Option to view phpinfo()
    • Basic magento configuration
    • Display of enabled and disabled modules

Security

It is safe to add this module to your own vcs by default. The profiler is only active when you are visiting your page via "dev.php", which is restricted to request from localhost by default.

If you are using a vm you have to allow your host system to access the profiler. This can be done by modify the webserver config or the dev.php itself

Webserver: To allow the access to the profiler you have to set "$_SERVER['ALLOW_PROFILER'] = 1"

Nginx: fastcgi_param ALLOW_PROFILER '1'; Apache: SetEnv ALLOW_PROFILER "1"

Unlock special features

  • Open files in your editor

    As symfony does, the profiler also widely supports "xdebug.file_link_format". If set up correctly it will allow you to click on most file references in the profiler to directly open it in your editor:

    Example for PHP Storm
    xdebug.file_link_format = "//localhost:63342/api/file/%f:%l"
    Note: ommit the "protocol" in the link to make sure it will work on http and https without the need open a new tap

    If you are using a virtual machine dont forget to also set "Host Magento Root Path" in the settings section. You can also set the "file_link_format" in the settings section directly.

TODO

  • Improve docs
  • "how to extend"
  • capture emails
  • performance tab

Mixed

If you get a gateway timeout 503 instead of an error message please try to adjust your nginx config

http {
    ...
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    ...
}

Need help?

Feel free to contact me jk@ecocode.de

Thanks to

ecocode/magento_profiler 适用场景与选型建议

ecocode/magento_profiler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.35k 次下载、GitHub Stars 达 62, 最近一次更新时间为 2016 年 09 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「logging」 「performance」 「toolbar」 「profiler」 「magento」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ecocode/magento_profiler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ecocode/magento_profiler 我们能提供哪些服务?
定制开发 / 二次开发

基于 ecocode/magento_profiler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 62
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 62
  • Watchers: 12
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-27