chore: lots of changes
This commit is contained in:
1
public/assets/css-CKd28aW2.js
Normal file
1
public/assets/css-CKd28aW2.js
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
public/assets/css-CLfz37Tz.css
Normal file
1
public/assets/css-CLfz37Tz.css
Normal file
@@ -0,0 +1 @@
|
||||
p{color:red}html{background:#00f}
|
||||
12
public/assets/css/styles.css
Normal file
12
public/assets/css/styles.css
Normal file
@@ -0,0 +1,12 @@
|
||||
* {
|
||||
|
||||
}
|
||||
|
||||
|
||||
footer > nav {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
footer > nav > li {
|
||||
flex-direction: row;
|
||||
}
|
||||
1
public/assets/js-DjO_n7Y6.js
Normal file
1
public/assets/js-DjO_n7Y6.js
Normal file
@@ -0,0 +1 @@
|
||||
import"./css-CKd28aW2.js";
|
||||
0
public/favico.ico
Normal file
0
public/favico.ico
Normal file
7
public/health.php
Normal file
7
public/health.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$status = ['status' => 'ok'];
|
||||
|
||||
echo json_encode($status);
|
||||
84
public/index.php
Normal file
84
public/index.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Framework\Core\Discovery;
|
||||
use App\Framework\Core\DynamicRoute;
|
||||
use App\Framework\Core\PhpObjectExporter;
|
||||
use App\Framework\Core\RouteCache;
|
||||
use App\Framework\Core\RouteMapper;
|
||||
use App\Framework\Core\StaticRoute;
|
||||
use App\Framework\ErrorHandling\ErrorHandler;
|
||||
use App\Framework\Http\HttpMethod;
|
||||
use App\Framework\Router\RouteCollection;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Fehleranzeige für die Entwicklung aktivieren
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$rfl = new ReflectionClass(Discovery::class);;
|
||||
$ghost = $rfl->newLazyGhost(function (Discovery $object) {
|
||||
// Initialize object in-place
|
||||
$object->__construct();
|
||||
});
|
||||
|
||||
|
||||
/*$clientrequest = new \App\Framework\HttpClient\ClientRequest(HttpMethod::GET, 'https://jsonplaceholder.typicode.com/posts');
|
||||
|
||||
$client = new \App\Framework\HttpClient\CurlHttpClient();
|
||||
|
||||
var_dump($client->send($clientrequest));*/
|
||||
|
||||
$emitter = new \App\Framework\Http\ResponseEmitter();
|
||||
ErrorHandler::register($emitter);
|
||||
|
||||
#echo dirname(__DIR__) . '/cache/routes.cache.php';
|
||||
|
||||
$discovery = new Discovery(new \App\Framework\Core\RouteMapper());
|
||||
|
||||
$results = $discovery->discover(__DIR__ . '/../src/Application/');
|
||||
|
||||
|
||||
$rc = new \App\Framework\Core\RouteCompiler();
|
||||
|
||||
$routes = $rc->compile($results[\App\Framework\Attributes\Route::class]);
|
||||
|
||||
$cacheFile = dirname(__DIR__) . '/cache/routes.cache.php';
|
||||
|
||||
$routeCache = new \App\Framework\Core\RouteCache($cacheFile);
|
||||
|
||||
$routeCache->save($routes);
|
||||
|
||||
$request = new \App\Framework\Http\HttpRequest(
|
||||
method: \App\Framework\Http\HttpMethod::tryFrom($_SERVER['REQUEST_METHOD'] ?? 'GET'),
|
||||
path:parse_url( $_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH),
|
||||
);
|
||||
|
||||
#var_dump("<pre>", $routeCache->load());
|
||||
|
||||
$router = new \App\Framework\Router\HttpRouter(new RouteCollection($routeCache->load()));
|
||||
|
||||
$match = $router->match($request->method->value, $request->path);
|
||||
|
||||
|
||||
$dispatcher = new \App\Framework\Router\RouteDispatcher();
|
||||
$return = $dispatcher->dispatch($match);
|
||||
|
||||
$responder = new \App\Framework\Router\RouteResponder();
|
||||
$response = $responder->respond($return);
|
||||
|
||||
$emitter = new \App\Framework\Http\ResponseEmitter();
|
||||
$emitter->emit($response);
|
||||
|
||||
/*$redis = new Predis\Client([
|
||||
'scheme' => 'tcp',
|
||||
'host' => 'redis', // Service-Name aus docker-compose
|
||||
'port' => 6379,
|
||||
]);
|
||||
|
||||
$redis->set('hello', 'world');
|
||||
echo $redis->get('hello'); // Gibt: world aus*/
|
||||
|
||||
exit;
|
||||
Reference in New Issue
Block a user