Files
dpl/scripts/theme-fuc/integration-router.php
T
hellcat 0501711267 feat(fuc-xb): prepare isolated staging theme and VIP auto upgrades
Port the Fuc 0.12.0 frontend and default-off VIP plugin. Include the previously approved password-reset token revocation. Deploy only to an independent FUC-XB test instance; no production cutover.
2026-11-04 13:44:33 +08:00

20 lines
2.0 KiB
PHP

<?php
// Loopback only, disposable acceptance instance, not a production entry point.
$path=parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH);
if(str_starts_with($path,'/theme/Fuc/assets/')){
$base=realpath(__DIR__.'/../../theme/Fuc/assets');$file=realpath($base.'/'.substr(rawurldecode($path),strlen('/theme/Fuc/assets/')));
if(!$file||!str_starts_with($file,$base.'/')||!is_file($file)){http_response_code(404);exit;}
$types=['mjs'=>'text/javascript','js'=>'text/javascript','css'=>'text/css','html'=>'text/html','json'=>'application/json','svg'=>'image/svg+xml','png'=>'image/png','jpg'=>'image/jpeg','woff2'=>'font/woff2','woff'=>'font/woff'];
header('Content-Type: '.($types[pathinfo($file,PATHINFO_EXTENSION)]??'application/octet-stream'));header('Cache-Control: no-store');readfile($file);exit;
}
if($path!=='/'&&!str_starts_with($path,'/api/v1/')&&!str_starts_with($path,'/api/v2/')&&$path!=='/fuc-qa-admin'&&$path!=='/fuc-qa-admin/customer-service'&&!str_starts_with($path,'/customer-service/')&&!str_starts_with($path,'/admin-custom/')&&!str_starts_with($path,'/assets/admin/')&&!preg_match('#^/s/[a-f0-9]+$#D',$path)){http_response_code(404);exit;}
if (($path !== '/customer-service/status' && str_starts_with($path, '/customer-service/')) || str_starts_with($path, '/admin-custom/') || str_starts_with($path, '/assets/admin/')) {
$base=realpath(__DIR__.'/../../public'); $file=realpath($base.$path);
if(!$file || !str_starts_with($file,$base.'/') || !is_file($file)){http_response_code(404);exit;}
$types=['mjs'=>'text/javascript','js'=>'text/javascript','css'=>'text/css','json'=>'application/json','svg'=>'image/svg+xml','woff2'=>'font/woff2'];
header('Content-Type: '.($types[pathinfo($file,PATHINFO_EXTENSION)]??'application/octet-stream'));readfile($file);exit;
}
$app=require __DIR__.'/integration-bootstrap.php';
$kernel=$app->make(Illuminate\Contracts\Http\Kernel::class);
$request=Illuminate\Http\Request::capture();$response=$kernel->handle($request);$response->send();$kernel->terminate($request,$response);