17/04
2017
dev-master
9999999-devError Handler
MIT
The Requires
by Tomasz Ignaszak
exception error handler
Wallogit.com
2017 © Pedro Peláez
Error Handler
This package provides error handler interface, (*1)
"require" : {
"ignaszak/error-handler" : "dev-master"
}
<?php
/**
* Created by PhpStorm.
* User: tomek
* Date: 02.09.16
* Time: 14:45
*/
declare(strict_types=1);
use Ignaszak\ErrorHandler\Handler;
use Ignaszak\ErrorHandler\View\Dev\DevView;
include __DIR__ . '/vendor/autoload.php';
include 'included_file.php';
define('CONSTANT', 'demo');
// Start and register error handler with development interface
$handler = Handler::start(new DevView());
$handler->register();
// Make some errors for test
function test() {
$func('test');
}
test();
try {
throw new Exception();
} catch (Exception $e) {
$handler->catch($e);
}
If You are running your app in console you can use CliView., (*2)
<?php use Ignaszak\ErrorHandler\Handler; use Ignaszak\ErrorHandler\View\Cli\CliView; include __DIR__ . '/vendor/autoload.php'; $handler = Handler::start(new CliView()); $handler->register();
Error Handler
MIT
exception error handler