Fix lint: make scripts/demo/router.php PSR-12 compliant; tidy demo scripts
Lint / PHP (phpcs PSR-12) (push) Successful in 33s
Lint / JS (eslint) (push) Successful in 13s
Lint / PHP requirements (version + extensions) (push) Successful in 56s
Lint / Notify on failure (push) Skipped
Security / PHP Security (semgrep) (push) Successful in 2m14s
Lint / Deploy (push) Successful in 3s

This commit is contained in:
2026-10-03 16:59:02 -04:00
parent 051ef6c915
commit a7f684626c
4 changed files with 515 additions and 132 deletions
+13 -3
View File
@@ -1,6 +1,16 @@
<?php
$p = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$f = __DIR__ . '/tinker' . $p;
if ($p !== '/' && is_file($f) && !str_ends_with($f, '.php')) { return false; }
/**
* 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';