zemistr / notorm-tracy-panel
NotORM panel for Tracy
Installs: 1 547
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 2
Requires
- php: >=7.1.0
- nette/utils: ^3.0
- tracy/tracy: ^2.6
- vrana/notorm: dev-master
- yep/reflection: ^2.0
Requires (Dev)
- phpstan/phpstan: ^0.12.18
- phpstan/phpstan-nette: ^0.12.6
- symplify/easy-coding-standard: ^7.2
This package is not auto-updated.
Last update: 2024-12-18 15:24:31 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?
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)