mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
feat: extract MediaController, wire into Dispatcher, delete media.php
This commit is contained in:
26
app/router.php
Normal file
26
app/router.php
Normal 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;
|
||||
Reference in New Issue
Block a user