8 lines
2.3 KiB
PHP
8 lines
2.3 KiB
PHP
<?php
|
|
ini_set('zend.exception_ignore_args','1');putenv('STABILITY_QA_MODE=consumers');$b8Root=dirname(__DIR__,2);$app=require $b8Root.'/storage/app/private/investmoz-v2/portal-audit/portal-stability-source-20261011_083742/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 required');$db->beginTransaction();$db->statement('SET TRANSACTION READ ONLY');try{
|
|
$context=json_decode(file_get_contents(__DIR__.'/option-B8-context-progress.json'),true,512,JSON_THROW_ON_ERROR);$land=App\Models\LandAssistanceCase::findOrFail($context['case_id']);$user=App\Models\User::findOrFail(21);config(['investor-path.enabled'=>false]);
|
|
$make=function(?string$id,array$payload)use($user){$r=App\Http\Requests\StoreLandAssistanceCaseRequest::create('/investidor/terra-duat'.($id?'/'.$id:''),$id?'PUT':'POST',['version'=>1,'payload'=>$payload]);$r->setContainer(app());$r->setUserResolver(fn()=>$user);$route=new Illuminate\Routing\Route($id?'PUT':'POST','investidor/terra-duat'.($id?'/{id}':''),fn()=>null);$route->bind($r);$r->setRouteResolver(fn()=>$route);$v=Illuminate\Support\Facades\Validator::make($r->all(),$r->rules());$r->withValidator($v);return $v;};
|
|
$keep=$make($land->id,$land->payload);if($keep->fails())throw new RuntimeException('Existing context prevented direct tool editing');$new=$make(null,['investor_path_case_id'=>$context['dossier_id']]);if(!$new->fails()||!$new->errors()->has('payload.investor_path_case_id'))throw new RuntimeException('New disabled path context accepted');
|
|
$p=['at'=>gmdate('c'),'target'=>$t,'SQL_read_only'=>true,'result'=>'passed','no_writes'=>true,'path_disabled_existing_bound_tool_payload_accepted'=>true,'path_disabled_new_context_rejected'=>true,'phases_and_steps_not_modified'=>true,'Superuser_alone_manage_portal'=>App\Models\User::findOrFail(27)->can('manage-portal')];if($p['Superuser_alone_manage_portal'])throw new RuntimeException('Administrative role unexpectedly gains land management');file_put_contents(__DIR__.'/option-B8-context-compatibility.json',json_encode($p,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($p);
|
|
}finally{$db->rollBack();}
|