Wallogit.com
2017 © Pedro Peláez
Phalcon Debug toolbar
Include it in your composer.json file, (*1)
{
"require-dev": {
"phalcon-tools/debugger": "dev-master"
}
}
Define a debug or environment flag in your application bootstrap file so you can easily disable the Phalcon Debug Widget on production environments. e.g., (*2)
define('PHALCON_DEBUG', true);
After you have setup your \Phalcon\Loader and \Phalcon\DI\FactoryDefault() create a new instance of the debug widget., (*3)
if (PHALCON_DEBUG == true) {
$debugWidget = new \Phalcon\Debug\DebugWidget($di);
}
That's it! The Phalcon debug widget should appear along the bottom of your application!, (*4)
The debug widget for now is very simplistic, however can be useful. It expects you have three services in your dependency injector named:, (*5)
It expects these services to match the Phalcon services of the same name., (*6)
When you pass the DI to Phalcon Debug Widget It looks for those specific services and does the following:, (*7)
This means passing the DI to the debug widget will alter those services. Generally speaking, a shared db, dispatcher, and view is fine. If you have ideas for other ways to hook in, please open an issue for discussion., (*8)
The Phalcon Debug Widget is designed to make development easier by displaying debugging information directly in your browser window. Currently it displays php globals such as $_SESSION as well as outputing resource usage and database queries and connection information., (*9)
Preview of the available debug panels, (*10)
, (*11)
, (*12)
, (*13)
, (*14)