nin / phalcon-debugbar
Integrates PHP Debug Bar with Phalcon 5.
v1.0.0
2023-02-18 04:12 UTC
Requires
- php: ^8.0.0
- maximebf/debugbar: ^1
This package is auto-updated.
Last update: 2025-01-18 08:51:53 UTC
README
This is a package to integrate PHP Debug Bar with Phalcon 5.
Note: Use the DebugBar only in development. It can slow the application down (because it has to gather data). So when experiencing slowness, try disabling some of the collectors.
Installation:
Require this package with composer. It is recommended to only require the package for development.
composer require nin/phalcon-debugbar --dev
Register a Provider in index.php
$container = new \Phalcon\Di\FactoryDefault(); $container->register(new \Nin\Debugbar\ServiceProvider());
Usage:
Add Message
use Nin\Debugbar\Phalcon\Helper\Debugbar; Debugbar::info($object); Debugbar::error('Error!'); Debugbar::warning(new \Phalcon\Config\Config(['title' => 'Warning']));
Add start/stop timing:
use Nin\Debugbar\Phalcon\Helper\Debugbar; Debugbar::startMeasure('function', 'Function runtime'); Debugbar::stopMeasure('function'); Debugbar::measure('function', function() { // Do something… });
Add Log Exception:
use Nin\Debugbar\Phalcon\Helper\Debugbar; try { // Do something } catch (Exception $e) { Debugbar::addThrowable($e); }