feat: implement global autoresponder plugin

This commit is contained in:
Marek Miklewicz
2026-06-02 19:19:00 +02:00
commit 6f989af278
62 changed files with 2018 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
final class Http
{
public static function method(): string
{
return strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? 'GET'));
}
public static function isPost(): bool
{
return self::method() === 'POST';
}
/**
* @param array<string,mixed> $source
*/
public static function getString(array $source, string $key, string $default = ''): string
{
$value = $source[$key] ?? $default;
return is_scalar($value) ? trim((string)$value) : $default;
}
public static function redirect(string $url): void
{
header('Location: ' . $url, true, 302);
exit;
}
}