PHP code example of dhazelett / stack-whoops

1. Go to this page and download the library: Download dhazelett/stack-whoops 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/ */

    

dhazelett / stack-whoops example snippets


use Silex\Application;
use Stack\Builder;

= (new Builder)
    ->push('Saphire\Middleware\Whoops', [
        // STRING! name of the \Whoops\Handler\* to use
        'handler' => '\Whoops\Handler\PrettyPageHandler'
    ])
;

// Try it out
$app->get('/', function() {
    throw new \Exception('Oh No!');
});

$server = $stack->resolve($app);

$response = $server->handle($request)->send();

$server->terminate($request, $response);