2017 © Pedro Peláez
 

library dbug

A very lightweight Error/Exception handler for PHP

image

ghostff/dbug

A very lightweight Error/Exception handler for PHP

  • Sunday, October 15, 2017
  • by Ghostff
  • Repository
  • 2 Watchers
  • 5 Stars
  • 24 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Dbug a *very lightweight Error/Exception handler for PHP(7+)

Latest Stable Version License Latest Stable Version Minimum PHP Version

Installation

You can download the Latest release version as a standalone, alternatively you can use Composer, (*1)

$ composer require ghostff/dbug

```json "require": { "ghostff/dbug": "^1.0" }, (*2)


Basic usage: ```php 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: Screenshot, (*3)

Using callback function:, (*4)

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:, (*5)

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., (*6)

The Versions

15/10 2017

dev-master

9999999-dev

A very lightweight Error/Exception handler for PHP

  Sources   Download

BSD

The Requires

  • php >=7.0.0

 

by Chrys Ugwu

error exception-handler error-handling error-log debuger error-reporting

06/10 2017

v1.0.1

1.0.1.0

A very lightweight Error/Exception handler for PHP

  Sources   Download

BSD

The Requires

  • php >=7.0.0

 

by Chrys Ugwu

error exception-handler error-handling error-log debuger error-reporting

08/07 2017

v1.0.0

1.0.0.0

A very lightweight Error/Exception handler for PHP

  Sources   Download

BSD

The Requires

  • php >=7.0.0

 

by Chrys Ugwu

error exception-handler error-handling error-log debuger error-reporting