Files
tinker_tickets/scripts/demo/router.php
T

17 lines
456 B
PHP
Raw Normal View History

<?php
/**
* Router script for PHP's built-in web server, used only for the local screenshot demo.
* Serves real static files directly and sends everything else to the application's index.php.
*/
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$file = __DIR__ . '/tinker' . $path;
if ($path !== '/' && is_file($file) && !str_ends_with($file, '.php')) {
return false;
}
chdir(__DIR__ . '/tinker');
require __DIR__ . '/tinker/index.php';