zemistr/notorm-tracy-panel

NotORM panel for Tracy

v2.0.0 2020-10-04 15:23 UTC

This package is not auto-updated.

Last update: 2024-07-17 13:33:02 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

v2.0.0 (2020-10-04)

  • Big thanks to @janbarasek! Amazing job! ❤️
  • Big package upgrade - PHPStan, PHP 7.1+, Nette 3, Tests and so on!

v1.0.1 (2017-01-30)

  • Add new versions of packages

v1.0.0 (2015-01-13)

  • initial release

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