<?php
$mode=$argv[1]??'';$lane=$mode==='wrong-lane'?'C':'B';putenv('FOOD_LANE='.$lane);if($mode!=='missing-flag')define('FOOD_TCHEF_PROCESS_ISOLATION',true);
if($mode==='original-loaded')require __DIR__.'/source/application/common/service/tchef/Config.php';
try{require __DIR__.'/TchefProcessConfig.php';if(in_array($mode,['missing-flag','wrong-lane','original-loaded'],true))throw new LogicException('Guard incorrectly accepted');if(\app\common\service\tchef\Config::load()!==[])throw new LogicException('Isolation must explicitly disable');if($mode==='duplicate-loaded'){try{require __DIR__.'/TchefProcessConfig.php';throw new LogicException('Duplicate accepted');}catch(RuntimeException $e){if($e->getMessage()!=='Refuse replacing an already loaded Config class')throw $e;}}echo json_encode(['guard'=>$mode,'accepted'=>true,'DB'=>0]),"\n";}
catch(RuntimeException $e){if(!in_array($mode,['missing-flag','wrong-lane','original-loaded'],true))throw $e;if($mode==='original-loaded'&&(new ReflectionClass(\app\common\service\tchef\Config::class))->getFileName()!==__DIR__.'/source/application/common/service/tchef/Config.php')throw new LogicException('Original class replaced');echo json_encode(['guard'=>$mode,'rejected'=>true,'reason'=>$e->getMessage(),'DB'=>0]),"\n";}
