start rework for 2025
This commit is contained in:
parent
81c47d94ca
commit
b2fb8bee39
14 changed files with 214 additions and 1589 deletions
5
implementation/01/public/index.php
Normal file
5
implementation/01/public/index.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../Bootstrap.php';
|
5
implementation/01/src/Bootstrap.php
Normal file
5
implementation/01/src/Bootstrap.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
echo 'Hello world!';
|
19
implementation/02/composer.json
Normal file
19
implementation/02/composer.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "lubiana/no-framework",
|
||||
"type": "project",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Lubiana\\NoFramework\\": "src/"
|
||||
}
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "lubiana",
|
||||
"email": "lubiana@hannover.ccc.de"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.4"
|
||||
}
|
||||
}
|
5
implementation/02/public/index.php
Normal file
5
implementation/02/public/index.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../Bootstrap.php';
|
7
implementation/02/src/Bootstrap.php
Normal file
7
implementation/02/src/Bootstrap.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lubiana\NoFramework;
|
||||
|
||||
echo 'Hello world!';
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"name": "lubiana/no-framework",
|
||||
"type": "project",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Lubiana\\NoFramework\\": "src/"
|
||||
|
@ -7,12 +9,12 @@
|
|||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "example",
|
||||
"email": "test@example.com"
|
||||
"name": "lubiana",
|
||||
"email": "lubiana@hannover.ccc.de"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"filp/whoops": "^2.14"
|
||||
"php": "^8.4",
|
||||
"filp/whoops": "^2.18"
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
|
@ -1,3 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../src/Bootstrap.php';
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../src/Bootstrap.php';
|
|
@ -1,27 +1,38 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
namespace Lubian\NoFramework;
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lubiana\NoFramework;
|
||||
|
||||
use Throwable;
|
||||
use Whoops\Handler\CallbackHandler;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
use Whoops\Run;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$environment = getenv('ENVIRONMENT') ?: 'dev';
|
||||
$environment = getenv('APP_ENV') ?: 'dev';
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$whoops = new Run();
|
||||
$whoops = new Run;
|
||||
$whoops->pushHandler(
|
||||
new CallbackHandler(
|
||||
function (Throwable $e) use ($environment) {
|
||||
if ($environment !== 'dev') {
|
||||
http_response_code(500);
|
||||
echo 'Whoops';
|
||||
}
|
||||
error_log(<<<TXT
|
||||
Error: {$e->getMessage()}
|
||||
{$e->getTraceAsString()}
|
||||
TXT
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
if ($environment === 'dev') {
|
||||
$whoops->pushHandler(new PrettyPageHandler());
|
||||
} else {
|
||||
$whoops->pushHandler(function (\Throwable $t) {
|
||||
error_log('ERROR: ' . $t->getMessage(), $t->getCode());
|
||||
echo 'Oooopsie';
|
||||
});
|
||||
$whoops->pushHandler(new PrettyPageHandler);
|
||||
}
|
||||
|
||||
$whoops->register();
|
||||
|
||||
echo 'Hello World!';
|
||||
throw new \Exception('Hello world');
|
1516
implementation/12/composer.lock
generated
1516
implementation/12/composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue