okneloper / debug
Debug tools for PHP applications
dev-master
2018-10-07 15:57 UTC
Requires
- php: >=5.6.0
- firephp/firephp-core: ^0.4.0
Requires (Dev)
- phpunit/phpunit: >=5.7
This package is auto-updated.
Last update: 2025-01-08 07:58:45 UTC
README
Register this error handler to see PHP errors in your browsers console using FirePHP.
Installation
Install the using composer
:
composer require okneloper/debug
Also install FirePHP extension e.g.: FirePHP Chrome Extension
Usage
Register the FirePHP Handler:
\Okneloper\Debug\Debug::registerFirePhpHandler(); echo ${'undefined variable'};
See PHP notice in the broswer console.
Configuration
Set the root path
Set the root path of your application to exclude it from the error file path:
$debug = \Okneloper\Debug\Debug::registerFirePhpHandler(); $debug->setRootPath('/home/user/public_html');
Before:
Notice: Undefined variable: undefined variable
in /home/user/public_html/public/index.php on line 25
After
Notice: Undefined variable: undefined variable
in public/index.php on line 25