readd implementation folder
This commit is contained in:
parent
7ff078b16f
commit
a4f171b98c
80 changed files with 8471 additions and 0 deletions
34
implementation/04/src/Bootstrap.php
Normal file
34
implementation/04/src/Bootstrap.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Lubian\NoFramework;
|
||||
|
||||
use Throwable;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
use Whoops\Run;
|
||||
|
||||
use function error_log;
|
||||
use function error_reporting;
|
||||
use function getenv;
|
||||
|
||||
use const E_ALL;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$environment = getenv('ENVIRONMENT') ?: 'dev';
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$whoops = new Run;
|
||||
|
||||
if ($environment === 'dev') {
|
||||
$whoops->pushHandler(new PrettyPageHandler);
|
||||
} else {
|
||||
$whoops->pushHandler(function (Throwable $t) {
|
||||
error_log('ERROR: ' . $t->getMessage(), $t->getCode());
|
||||
echo 'Oooopsie';
|
||||
});
|
||||
}
|
||||
|
||||
$whoops->register();
|
||||
|
||||
echo 'Hello World!';
|
Loading…
Add table
Add a link
Reference in a new issue