PHP code example of bkrukowski / error-dumper

1. Go to this page and download the library: Download bkrukowski/error-dumper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bkrukowski / error-dumper example snippets


$pathToLib = 'here put path to error-dumper library';

\ErrorDumper\Magic::registerErrorDumper();

if ($isInTestEnvironment)
{
    \ErrorDumper\Magic::registerErrorDumper();
}
else
{
    \ErrorDumper\Magic::registerErrorCallback(function ($e) {
        /** @var \Exception|\Throwable $e */
        // save error somewhere, for example:
        // $output = \ErrorDumper\Magic::exportExceptionToLightHtml($exception);
        // \Foo\MyErrorStorage::addHtmlError($output);
        exit(1);
    });
}

\ErrorDumper\Magic::registerErrorDumper(new \ErrorDumper\Editors\MacVim());

$output = \ErrorDumper\Magic::exportExceptionToLightHtml($exception);