zemistr/notorm-tracy-panel

NotORM panel for Tracy

v1.0.1 2017-01-30 11:39 UTC

This package is not auto-updated.

Last update: 2020-05-26 18:27:44 UTC


README

NotORM Panel for Tracy for debugging

Instalation

Fastest use with all comforts

NotOrmTracyPanel::simpleInit($notorm, $pdo);

or just

NotOrmTracyPanel::simpleInit($notorm);

Basic usage

$panel = NotOrmTracyPanel::getInstance(); // or new NotOrmTracyPanel()
\Tracy\Debugger::getBar()->addPanel($panel);

$notorm->debug = function($query, $parameters) {
	NotOrmTracyPanel::getInstance()->logQuery($query, $parameters);
};

Using with time measurement

$panel = NotOrmTracyPanel::getInstance(); // or new NotOrmTracyPanel()
\Tracy\Debugger::getBar()->addPanel($panel);

$notorm->debug = function($query, $parameters) {
	$instance = NotOrmTracyPanel::getInstance();
	$instance->logQuery($query, $parameters);
    $instance->startQueryTimer($instance->getIndex());
};

$notorm->debugTimer = function () {
	$instance = NotOrmTracyPanel::getInstance();
    $instance->stopQueryTimer($instance->getIndex());
};

You can set driver info

$panel->setPlatform($pdo->getAttribute(PDO::ATTR_DRIVER_NAME));

You can use SQL Explain utility, if you set NotORM or PDO connection

$panel->setNotOrm($notorm);

or

$panel->setPdo($pdo);

Result?

Panel

Changelog

v1.0.0 (2015-01-13)

  • initial release

v1.0.1 (2017-01-30)

  • Add new versions of packages

(c) Martin Zeman (Zemistr), 2015 (http://zemistr.eu)