定制 dzegarra/tracy-mysqli 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dzegarra/tracy-mysqli

最新稳定版本:1.1.1

Composer 安装命令:

composer require dzegarra/tracy-mysqli

包简介

This lib extends mysqli to allow you to see all your executed queries. It also includes a Bar Panel for Tracy

README 文档

README

This lib allow you to see all your executed SQL queries when you are using the MySQLi php driver. It also includes a Bar Panel for Tracy, see the result below.

Result

MySQLi logger with Tracy

Installation

Install it via composer:

composer require dzegarra/tracy-mysqli

How to use

// Create an instance for Tracy Bar Panel
$panel = new \Dzegarra\TracyMysqli\BarPanel();

// Add the panel to Tracy
\Tracy\Debugger::getBar()->addPanel($panel);

// Make a connection to the DB using the \Dzegarra\TracyMysqli\Mysqli class instead of mysqli
$conn = new \Dzegarra\TracyMysqli\Mysqli("hostname", "username", "password", "database");

// Execute your queries

How it works

First you need to add the panel to the Tracy bar. The panel won't be render until the shutdown process kick in (either way the script ends or you call die or exit).

Just before the panel start to render the list of all the SQL querys will be fetched from the Mysqli class.

All the queries are store in a static variable in the Mysqli so, no matters how many instances of the Mysqli class you create, all the queries of all the instances will be store.

Inspiration and credits

This repo is based in filisko/pdo-plus.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-24