tregor/error-handler

Beautiful and informative PHP Error Handler!

1.1.3 2021-05-07 16:22 UTC

This package is auto-updated.

Last update: 2024-04-07 23:01:23 UTC


README

Total Downloads GitHub Version Last Commit PHP Req License

PHP library for handling exceptions and errors! (Now with direct href to StackOverflow 😉 )

Debug is never been so cool and easy!😃

(C) Bill Gates

Make handlers great again!😎

(C) Steve Jobs

I have sex with that library!!!😍

(C) Bill Clinton

Okay, let's see what this library can...😏

(C) Typical Programmer

This library turns debugging from a boring and monotonous work into a simple and easy process with a beautiful interface and smart error tracking!

According to the fictional statistics, when using this library, the fix of errors occurs in 87.13% faster compared to without the library!

If you start using this library right now, then we will give you access to the StackOverflow website for 1 year ABSOLUTELY FREE!

We will also give you the certificate of "BaD DeV" if you recommend this library to your friends!

And finally: this is my first public library, which is not made of shit and sticks. Thanks for using!:blush:

Navigation

Requirements

This library is supported by PHP versions 5.4 or higher.

Installation

The preferred way to install this extension is through Composer.

To install PHP ErrorHandler library, simply:

$ composer require tregor/error-handler

You can also clone the complete repository with Git:

$ git clone https://github.com/tregor/ErrorHandler.git

Or install it manually:

Download ErrorHandler.php:

$ wget https://github.com/tregor/ErrorHandler/archive/master.zip

Available Methods

Available methods in this library:

- Set renderer template:

To set custom renderer template, that you can download appart or create yourself, you must provide those code:

ErrorHandler::setTemplate(string $templateName);

- Set trace depth:

By default trace depth is 0, equivalent to infinity. You can set trace steps depth by providing those code:

ErrorHandler::setTraceDepth(integer $traceDepth);

Quick Start and Usage

To use this class with Composer:

require __DIR__ . '/vendor/autoload.php';

new tregor\ErrorHandler\ErrorHandler;

Or If you installed it manually, use it:

require_once __DIR__ . '/ErrorHandler.php';

new tregor\ErrorHandler\ErrorHandler;

Images

EXCEPTION Handler: image

ERROR Handler: image

WARNING Handler: image

NOTICE Handler: image

TODO

  • Make some settings.
  • Improve documentation.
  • Add enviroment variables on debug page.
  • Update colors in template.
  • Include CLI version of error respond.
  • Refactor code.
  • Make it better.
  • Take a cup of coffee.

Contribute

If you would like to help, please take a look at the list of issues or the ToDo checklist.

Pull requests

License

This project is licensed under MIT license. See the LICENSE file for more info.

Copyright

By tregor 2019

Please let me know if you have feedback or suggestions.

You can contact me on Telegram or through my email.