Files
Investidor-V2/tools/demography-qa-router.php
T
2026-11-21 20:58:19 +02:00

23 lines
1.4 KiB
PHP

<?php
use App\Support\IsolatedQaDatabase;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Vite;
$root = dirname(__DIR__);
$requestPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$resolved = is_string($requestPath) ? realpath($root.'/public'.$requestPath) : false;
if ($resolved && str_starts_with(str_replace('\\', '/', $resolved), str_replace('\\', '/', $root).'/public/') && is_file($resolved) && in_array(strtolower(pathinfo($resolved, PATHINFO_EXTENSION)), ['js', 'css', 'png', 'jpg', 'jpeg', 'svg', 'ico', 'webp', 'woff', 'woff2'], true)) {
return false;
}
require $root.'/vendor/autoload.php';
$app = require $root.'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
throw_unless(IsolatedQaDatabase::allowsSchemaChanges() && config('database.connections.pgsql.database') === 'investmoz_demography_test', RuntimeException::class, 'Dedicated demographic QA server only.');
config(['portal.managers' => ['demography-qa@example.test'], 'portal.homologation_only' => false, 'session.driver' => 'file', 'session.cookie' => 'demography_qa_session', 'session.secure' => false, 'cache.default' => 'array']);
Vite::useBuildDirectory('build-qa-opportunities');
Vite::useHotFile(storage_path('framework/demography-qa.hot'));
header('X-Investmoz-QA-Target: investmoz_demography_test:55441');
$app->handleRequest(Request::capture());