Dbug
PHP7 Error/Exception Handler
Install / Use
/learn @Ghostff/DbugREADME
Dbug a *very lightweight Error/Exception handler for PHP(7+)
Installation
You can download the Latest release version as a standalone, alternatively you can use Composer
$ composer require ghostff/dbug
"require": {
"ghostff/dbug": "^1.0"
}
Basic usage:
use Dbug\BittrDbug;
/**
* @param error handle type
* @param theme name (bittr|default|yola). Themes can be configures in theme.json
* @param lines of code to cover before and after the error.
*/
new BittrDbug(BittrDbug::PRETTIFY, 'yola', 20);
#This should be implemented before any other script execution except your autoloader(if using one).
Error/Exception Display:

Using callback function:
use Dbug\BittrDbug;
new BittrDbug(function (BittrDbug $e) {
var_dump(
$e->getMessage(); # returns string;
$e->getCode(); # returns int;
$e->getFile(); # returns string;
$e->getLine(); # returns int;
$e->getTrace(); # returns array;
$e->getTraceAsString(); # returns string;
);
});
#This should be implemented before any other script execution except your autoloader(if using one).
You can also log errors instead of outputting them in browser:
use Dbug\BittrDbug;
/**
* @param error handle type
* @param path to save log files.
*/
new BittrDbug(BittrDbug::FILE_LOG, 'path/to/my/log/');
#This should be implemented before any other script execution except your autoloader(if using one).
For file logging, you can set your path to a directory outside your webroot or maybe add a .htaccess to prevent direct access to your log directory.
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
