initial commit

This commit is contained in:
torsten 2026-10-09 09:07:18 +02:00
commit 1db373a03d
110 changed files with 67830 additions and 0 deletions

42
src/bootstrap.php Normal file
View file

@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/*
* Bootstrap: lädt .env, Konfiguration, Autoloader, Session und startet die
* Anwendung. Wird sowohl vom Front-Controller als auch von CLI-Skripten
* eingebunden.
*/
define('BASE_PATH', dirname(__DIR__));
// Fehlerbehandlung
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Autoloader für den Namespace App\ (Quellen liegen in src/)
spl_autoload_register(function (string $class): void {
$prefix = 'App\\';
if (!str_starts_with($class, $prefix)) {
return;
}
$relative = substr($class, strlen($prefix));
$file = BASE_PATH . '/src/' . str_replace('\\', '/', $relative) . '.php';
if (is_file($file)) {
require $file;
}
});
require_once BASE_PATH . '/src/helpers.php';
load_env_file(BASE_PATH . '/.env');
/** Startet eine Session (für Web-Requests). */
function start_session(): void
{
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
}