Files
Investidor-V2/outputs/investmoz-audit-current-20261012/option-B6-portfolio-cause.php
T
nala ba1c0340ea
tests / ci (push) Canceled after 0s
oportunidades 8
2026-10-14 08:25:30 +02:00

18 lines
1.9 KiB
PHP

<?php
ini_set('zend.exception_ignore_args','1');putenv('STABILITY_QA_MODE=consumers');
$b6Root=dirname(__DIR__,2);$b6QA=$b6Root.'/storage/app/private/investmoz-v2/portal-audit/portal-stability-source-20261011_083742';$app=require$b6QA.'/tools/portal-stability-runtime.php';
$db=Illuminate\Support\Facades\DB::connection();$t=(array)$db->selectOne('SELECT current_database() AS database,inet_server_port() AS port');
if($t!==['database'=>'stability_consumers_20261011_084534_test','port'=>55441])throw new RuntimeException('QA only');
$db->beginTransaction();$db->statement('SET TRANSACTION READ ONLY');
try{
$id='06b2d5d7-98ad-48db-b732-8a70b2f5eb4c';$r=Illuminate\Http\Request::create('/carteira/'.$id,'GET');$r->setUserResolver(fn()=>null);
try{app(App\Http\Controllers\InvestmentPortfolioController::class)->show($r,$id);$proof=['result'=>'controller_did_not_reproduce'];}
catch(Throwable$e){
$safe=null;if(preg_match('/(?:column|relation) [^\r\n]{1,180}(?:does not exist|is ambiguous)/',$e->getMessage(),$m))$safe=$m[0];
$frames=[];foreach($e->getTrace()as$f)if(isset($f['file'])&&str_starts_with(str_replace('\\','/',$f['file']),str_replace('\\','/',$b6QA).'/app/'))$frames[]=['file'=>str_replace('\\','/',substr($f['file'],strlen($b6QA)+1)),'line'=>$f['line']??null,'method'=>($f['class']??'').'::'.($f['function']??'')];
$proof=['result'=>'cause_reproduced_read_only','exception_class'=>get_class($e),'code'=>(string)$e->getCode(),'safe_schema_message'=>$safe,'application_frames'=>$frames];
}
$proof+=['at'=>gmdate('c'),'target'=>$t,'SQL_read_only'=>true,'active_writes'=>0,'stack_arguments_or_SQL_values_exported'=>false];
$dest=__DIR__.'/option-B6-portfolio-cause.json';if(is_file($dest))throw new RuntimeException('Preserve diagnosis');file_put_contents($dest,json_encode($proof,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR));echo json_encode($proof,JSON_UNESCAPED_UNICODE).PHP_EOL;
}finally{$db->rollBack();}