feat: extract MediaController, wire into Dispatcher, delete media.php

This commit is contained in:
Pontoporeia
2026-04-17 11:44:08 +02:00
parent b03be51b92
commit 75f808bee4
157 changed files with 1713 additions and 452 deletions

26
app/router.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/**
* Router script for PHP built-in development server (php -S).
*
* Routes /partage/<slug> to public/partage/index.php, since the built-in
* server has no URL rewriting like nginx's try_files.
*/
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
// Route /partage/<slug> and /partage/<slug>/<action> to the partage entry
if (preg_match('#^/partage(/.*)?$#', $uri)) {
$_SERVER['SCRIPT_NAME'] = '/partage/index.php';
require __DIR__ . '/public/partage/index.php';
return true;
}
// Route /tfe/<...> to tfe.php
if (preg_match('#^/tfe(/.*)?$#', $uri)) {
$_SERVER['SCRIPT_NAME'] = '/tfe.php';
require __DIR__ . '/public/tfe.php';
return true;
}
// Default: serve static files if they exist
return false;