7 lines
2.3 KiB
PHP
7 lines
2.3 KiB
PHP
<?php
|
|
require __DIR__.'/boot-compatibility-QA.php';
|
|
$db=Illuminate\Support\Facades\DB::connection();$db->beginTransaction();$db->statement('SET TRANSACTION READ ONLY');try{
|
|
$z=App\Models\InvestmentZone::findOrFail('0ae14c9a-1adb-4ee7-8094-d5d54d4e75f1');$details=app(App\Services\InvestmentZoneOperationalDetails::class);$management=app(App\Services\InvestmentZoneOperationalProfile::class)->management($z);$private=$management['operational_details']['integral'];$public=$details->publicData($z);$state=['target'=>$target,'private_integral_hash'=>hash('sha256',json_encode($private,JSON_THROW_ON_ERROR)),'public_hash'=>hash('sha256',json_encode([$public,$z->version_no,$z->published_at,$z->updated_at,$z->status],JSON_THROW_ON_ERROR)),'private_area'=>$private['plots'][0]['area'],'public_area'=>$public['integral']['plots'][0]['area'],'working_version'=>$management['version_no'],'public_version'=>$z->version_no];
|
|
$phase=$argv[1]??'';if($phase==='before'){if(is_file(__DIR__.'/COMPATIBILITY-BEFORE.json'))throw new RuntimeException('Preserve baseline');file_put_contents(__DIR__.'/COMPATIBILITY-BEFORE.json',json_encode($state,JSON_PRETTY_PRINT));}elseif($phase==='after'){$before=json_decode(file_get_contents(__DIR__.'/COMPATIBILITY-BEFORE.json'),true);foreach(['private_integral_hash','public_hash','private_area','public_area','public_version']as$k)if($state[$k]!==$before[$k])throw new RuntimeException('After-use data changed: '.$k);if($state['working_version']<=$before['working_version'])throw new RuntimeException('Previous editor save not demonstrated');$state['previous_editor_save_observed']=true;$state['previous_editor_source_sha256']=hash_file('sha256',$app->basePath().'/resources/js/pages/investment/zone.tsx');$state['active_editor_source_sha256']=hash_file('sha256',dirname(__DIR__,2).'/resources/js/pages/investment/zone.tsx');if($state['previous_editor_source_sha256']!==$state['active_editor_source_sha256'])throw new RuntimeException('Must be actual previous zone UI');$state['private_and_public_preserved']=true;$state['retained_functional_sources']=['app/Services/InvestmentZoneIntegralDetails.php','app/Services/InvestmentZoneOperationalDetails.php'];file_put_contents(__DIR__.'/COMPATIBILITY-QA.json',json_encode($state,JSON_PRETTY_PRINT));}else throw new RuntimeException('before/after only');echo json_encode($state).PHP_EOL;
|
|
}finally{$db->rollBack();}
|