$value) { putenv($key.'='.$value); $_ENV[$key] = $_SERVER[$key] = $value; } $public = realpath($settings['SGC_DISTRIBUTION_QA_PUBLIC']); $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $file = realpath($public.'/'.ltrim(rawurldecode($path), '/')); if ($file && str_starts_with(str_replace('\\', '/', $file), str_replace('\\', '/', $public).'/') && is_file($file)) { $mime = ['js' => 'text/javascript', 'css' => 'text/css', 'svg' => 'image/svg+xml', 'png' => 'image/png', 'ico' => 'image/x-icon', 'woff' => 'font/woff', 'woff2' => 'font/woff2']; $extension = pathinfo($file, PATHINFO_EXTENSION); if (isset($mime[$extension])) { header('Content-Type: '.$mime[$extension]); readfile($file); exit; } } require __DIR__.'/../../vendor/autoload.php'; $app = require __DIR__.'/../../bootstrap/app.php'; $app->usePublicPath($public); $app->handleRequest(Request::capture());