zim32/xhprof-profiler-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

zim32/xhprof-profiler-bundle

最新稳定版本:v1.1.0

Composer 安装命令:

composer require zim32/xhprof-profiler-bundle

包简介

This bundle add additional XHProf menu item in symfony debug toolbar

README 文档

README

Installation

Install tideways_xhprof extension

See https://github.com/tideways/php-xhprof-extension for instructions

Install this bundle

composer require zim32/xhprof-profiler-bundle

Open your .env.local file and add

ZIM_XHPROF_ENABLE=1

This will activate profiler.

Set ZIM_XHPROF_ENABLE=0, or remove entirely, to deactivate profiler

Navigate to debug toolbar and click on XHProf menu item. Profit

Picture

Conditional profiling

If you need to enable profiling based on some condition, you can use special variable ZIM_XHPROF_CONDITION

The value of this variable is passed to Symfony ExpressionLanguage component, with one variable called ctx. This expression must evaluate to bool value (true - enable profiling, false - disable)

CTX is initialized as follows:

$ctx->get = $_GET;
$ctx->post = $_POST;
$ctx->server = $_SERVER;
$ctx->cookie = $_COOKIE;

So for example to enable profiler only for your user session, you can use

ZIM_XHPROF_CONDITION='key_exists("PHPSESSID", ctx.cookie) && ctx.cookie["PHPSESSID"] === "bd465k5q41n8jsdd8iu99mmchk"'

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-05