mirror of
https://github.com/filp/whoops.git
synced 2026-09-17 05:06:22 +00:00
Add example.php
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Damnit - php errors for cool kids
|
||||
* @author Filipe Dobreira <http://github.com/filp>
|
||||
*
|
||||
* Run this example file with the PHP 5.4 web server with:
|
||||
*
|
||||
* $ cd project_dir
|
||||
* $ php -S localhost:8080
|
||||
*
|
||||
* and access localhost:8080/example.php through your browser
|
||||
*
|
||||
* Or just run it through apache/nginx/what-have-yous as usual.
|
||||
*/
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use Damnit\Run;
|
||||
use Damnit\Handler\PrettyPage;
|
||||
use Damnit\Handler\Handler;
|
||||
|
||||
$run = new Run;
|
||||
$run->pushHandler(new PrettyPage);
|
||||
$run->register();
|
||||
|
||||
|
||||
function fooBar() {
|
||||
throw new RuntimeException("hello, world!");
|
||||
}
|
||||
|
||||
fooBar();
|
||||
Reference in New Issue
Block a user