readd implementation folder

This commit is contained in:
lubiana 2022-05-19 23:39:08 +02:00
parent b33f0565c9
commit 1984efef72
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
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!';