rpg-westreiche/westreiche_website/tools/router.php

19 lines
425 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
/**
* Router für den lokalen Entwicklungsserver:
* php -S 127.0.0.1:8099 -t . tools/router.php
*/
$path = (string) parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
if ($path === '/install.php') {
require __DIR__ . '/../install.php';
return;
}
$file = __DIR__ . '/..' . $path;
if ($path !== '/' && is_file($file)) {
return false;
}
require __DIR__ . '/../index.php';