Initial commit: sync from server - all domains and code

This commit is contained in:
Hermes Agent
2026-05-18 22:12:40 +02:00
commit 22206d361a
54 changed files with 3636 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace App\Support;
final class Request
{
public function method(): string
{
return strtoupper($_SERVER['REQUEST_METHOD'] ?? 'GET');
}
public function path(): string
{
$uri = $_SERVER['REQUEST_URI'] ?? '/';
$path = parse_url($uri, PHP_URL_PATH) ?: '/';
return rtrim($path, '/') ?: '/';
}
public function query(string $key, mixed $default = null): mixed
{
return $_GET[$key] ?? $default;
}
public function input(): array
{
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
if (str_contains($contentType, 'application/json')) {
$raw = file_get_contents('php://input');
$decoded = json_decode($raw ?: '[]', true);
return is_array($decoded) ? $decoded : [];
}
return $_POST;
}
}