readd implementation folder

This commit is contained in:
lubiana 2022-05-19 23:39:08 +02:00 committed by Andre Lubian
parent 7ff078b16f
commit a4f171b98c
80 changed files with 8471 additions and 0 deletions

View file

@ -0,0 +1,18 @@
{
"name": "lubiana/no-framework",
"autoload": {
"psr-4": {
"Lubiana\\NoFramework\\": "src/"
}
},
"authors": [
{
"name": "example",
"email": "test@example.com"
}
],
"require": {
"php": ">=8.1",
"filp/whoops": "^2.14"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,3 @@
<?php declare(strict_types=1);
require __DIR__ . '/../src/Bootstrap.php';

View file

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Lubian\NoFramework;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
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!';