Files
SGF/scripts/budget-demo-router.php
T
2026-10-29 18:43:29 +02:00

12 lines
900 B
PHP

<?php
// Local-only test host configuration; credentials never exposed through HTTP or source control.
$settingsFile=getenv('BUDGET_DEMO_SETTINGS_FILE') ?: 'C:/laragon/data/sgf-tempo/secrets/budget-demo.json';
if (!in_array($settingsFile,['C:/laragon/data/sgf-tempo/secrets/budget-demo.json','C:/laragon/data/sgf-tempo/secrets/budget-proof.json'],true)) {http_response_code(503);exit('Invalid test settings target.');}
$settings=json_decode(file_get_contents($settingsFile),true,32,JSON_THROW_ON_ERROR);
if (!preg_match('/^budget_core_sgf_[a-f0-9]{12}$/D',$settings['DB_DATABASE']??'') || ($settings['DB_HOST']??'')!=='127.0.0.1' || ($settings['APP_ENV']??'')!=='budget-testing') {
http_response_code(503); exit('Invalid isolated demonstration configuration.');
}
foreach ($settings as $key=>$value) { putenv($key.'='.$value); $_ENV[$key]=$_SERVER[$key]=$value; }
require __DIR__.'/router.php';