5 lines
1.7 KiB
PHP
5 lines
1.7 KiB
PHP
<?php
|
|
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';$p=json_decode(file_get_contents($s['root'].'/bank-backup-pointer.json'),true);$before=json_decode(file_get_contents($p['root'].'/preservation-private.json'),true);$checks=[];foreach(['host'=>$host,'native'=>$native]as$name=>$db)foreach($before[$name]as$table=>$json){$rows=json_decode($json,true);$after=$db->table($table)->whereIn('id',array_column($rows,'id'))->orderBy('id')->get()->toJson();if($after!==$json)throw new LogicException('Original table changed '.$table);if($table!=='permission_grants'&&$db->table($table)->count()!==count($rows))throw new LogicException('Unexpected domain append '.$table);$checks[]=$name.'.'.$table;}
|
|
$proposal=json_decode(file_get_contents($repo.'/docs/integration/sgf-bank-reconciliation-access-proposal.json'),true);$existingIds=array_column(json_decode($before['host']['permission_grants'],true),'id');$added=$host->table('permission_grants')->whereNotIn('id',$existingIds)->get();if(count($added)!==8)throw new LogicException('Exact8 approved grants only');foreach($added as$g)if(!in_array($g->permission,$proposal['new_right_names'],true))throw new LogicException('Unexpected grant');if(hash_file('sha256',$s['root'].'/binding.json')!==$before['binding'])throw new LogicException('Original binding changed');
|
|
file_put_contents($work.'/bank-preservation.json',json_encode(['passed'=>true,'identical_original_tables'=>$checks,'journals'=>27,'new_grants'=>8,'native_writes'=>0,'six_protected_records'=>'No connections or commands target protected databases/records','blocked_cache'=>'No clear/delete','new_demo'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/bank-preservation.json']).PHP_EOL;
|