5 lines
1.7 KiB
PHP
5 lines
1.7 KiB
PHP
<?php
|
|
ini_set('zend.exception_ignore_args','1');$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432||!in_array($c['host'],['127.0.0.1','localhost']))throw new RuntimeException('Active identity guard');
|
|
use Illuminate\Support\Facades\DB;
|
|
DB::beginTransaction();DB::statement('SET TRANSACTION READ ONLY');try{$m=json_decode(file_get_contents($root.'/outputs/investmoz-orientacao-legado-consolidado-20261015/MANIFESTO-MINIMO.json'),true);$rows=[];foreach($m['documents']as$d){$matches=DB::table('documents')->where(fn($q)=>$q->where('external_id',$d['external_id'])->orWhere('sha256',$d['sha256']))->get(['id','external_id','sha256','status','deleted_at']);$rows[]=['external_id'=>$d['external_id'],'sha256'=>$d['sha256'],'existing'=>$matches];}$p=app(App\Services\VirtualDeskInstallation::class)->preview();$v=['at'=>gmdate('c'),'target'=>$p['target'],'SQL_read_only'=>true,'reader_enabled'=>app(App\Services\LegacyContent::class)->available(),'B_investor_path_enabled'=>(bool)config('investor-path.enabled'),'build_sha256'=>hash_file('sha256',$root.'/public/build/manifest.json'),'resources'=>$rows,'actor_2_manage_portal'=>App\Models\User::findOrFail(2)->can('manage-portal'),'scanner'=>$p['scanner'],'importer_restriction'=>'CLI --apply only testing/_test:55441; no active authenticated batch route found','source_changes'=>0,'imports'=>0,'publications'=>0,'flag_changes'=>0];file_put_contents(__DIR__.'/PREFLIGHT-READONLY.json',json_encode($v,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($v,JSON_THROW_ON_ERROR);}finally{DB::rollBack();}
|