.php durchsucht (Dateiname == Klassenname). */ final class Kernel { public static function boot(string $basePath): void { define('BSB_BASE', $basePath); define('BSB_UPLOADS', $basePath . '/public/uploads'); spl_autoload_register(static function (string $class) use ($basePath): void { static $dirs = [ 'app/Core', 'app/Database', 'app/Services', 'app/Controllers/Pages', 'app/Controllers/Api', ]; foreach ($dirs as $dir) { $file = $basePath . '/' . $dir . '/' . $class . '.php'; if (is_file($file)) { require $file; return; } } }); require $basePath . '/app/Support/helpers.php'; require $basePath . '/app/Database/migrations.php'; // globale Migrations-Definitionen Config::load($basePath . '/config/config.php'); session_start(); (new Router( require $basePath . '/app/routes/web.php', require $basePath . '/app/routes/api.php' ))->dispatch(); } }