13 lines
1.5 KiB
PHP
13 lines
1.5 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{
|
|
$actors=json_decode(file_get_contents($b6Root.'/storage/app/private/investmoz-v2/portal-audit/profiles-v1-actors-private.json'),true);$rows=[];
|
|
foreach(['promoter','colleague','outsider','validator','publisher','auditor','multiple']as$role){$u=App\Models\User::findOrFail($actors[$role]['id']);$rows[$role]=['id'=>$u->id,'synthetic_email'=>str_ends_with($u->email,'.invalid'),'manage_portal'=>$u->can('manage-portal'),'verified'=>$u->hasVerifiedEmail(),'MFA_configured'=>$u->two_factor_confirmed_at!==null];}
|
|
$proof=['at'=>gmdate('c'),'target'=>$t,'SQL_read_only'=>true,'active_writes'=>0,'existing_synthetic_actors'=>$rows,'empty_consumer_designations'=>true,'new_business_rule_added'=>false];
|
|
$dest=__DIR__.'/option-B6-business-designations-read.json';if(is_file($dest))throw new RuntimeException('Preserve reading');file_put_contents($dest,json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof).PHP_EOL;
|
|
}finally{$db->rollBack();}
|