mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
- Create app/public/index.php as front controller (bootstrap + Dispatcher) - Rewrite app/router.php for PHP dev server → all non-asset requests to index.php - Update Dispatcher to render full page layouts (head+header+view+footer) - Move public view templates into templates/public/ (home, search, tfe, about, repertoire) - Delete dead direct-access public/*.php files (apropos, search, tfe, licence, repertoire) - Add clean URL routes to Dispatcher (/search, /tfe, /repertoire, /apropos, /licence, /media) - Remove .php extensions from all internal links (header, views, templates, URLs) - Update OG tags in controllers to use clean URLs - Update nginx posterg.conf → front-controller try_files pattern, block direct .php access - Update header.php and search-bar.php form actions to clean URLs - Switch AboutController nav key from 'nav' to 'currentNav' for consistency
21 lines
688 B
PHP
21 lines
688 B
PHP
<?php
|
|
/**
|
|
* Router script for PHP built-in development server (php -S).
|
|
*
|
|
* All non-asset requests go through the front controller (public/index.php).
|
|
* Static files (CSS, JS, images, fonts) are served directly.
|
|
*/
|
|
|
|
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
|
|
// Static assets: let the dev server handle them directly
|
|
$ext = pathinfo($uri, PATHINFO_EXTENSION);
|
|
if (in_array($ext, ['css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg', 'woff', 'woff2', 'ttf', 'eot', 'map'], true)) {
|
|
return false; // serve directly
|
|
}
|
|
|
|
// Send everything else through the front controller
|
|
$_SERVER['SCRIPT_NAME'] = '/index.php';
|
|
require __DIR__ . '/public/index.php';
|
|
return true;
|