7 lines
2.9 KiB
PHP
7 lines
2.9 KiB
PHP
<?php
|
|
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';foreach([$run['root'].'/private/receipt-composition-b4093c6f6707/single-integration/20261110-213243-02cebb42/stock-catalogue-result.json',$run['root'].'/private/receipt-composition-b4093c6f6707/single-integration/20261110-213644-443f1ddd/stock-catalogue-boundaries.json',$run['root'].'/private/receipt-composition-b4093c6f6707/catalogue-concurrency-1794339220350/result.json']as$file)if((json_decode(file_get_contents($file),true)['passed']??false)!==true)throw new LogicException('Valid affected proofs required');
|
|
if(!is_file($s['root'].'/stock-catalogue-backup-pointer.json'))throw new LogicException('Selected backup missing');$files=['resources/js/app.jsx','resources/js/WorkspaceNavigation.jsx','app/Modules/Inventory/StockCatalogueController.php','app/Modules/Purchasing/ReceiptRuntime.php','app/Shared/Context/ModuleNavigation.php','app/Modules/Identity/Services/IdentityWorkflow.php','routes/web.php','resources/views/stock-catalogue-workspace.blade.php','public/sgf-stock-catalogue.mjs','resources/js/StockMenuWorkspace.jsx','database/sql/stock_catalogue.sql'];foreach($files as$file)if(str_ends_with($file,'.php'))(new Symfony\Component\Process\Process([PHP_BINARY,'-l',$repo.'/'.$file]))->mustRun();(new Symfony\Component\Process\Process(['C:/laragon/tools/sgf-tempo/node-v24.22.1-win-arm64/node.exe','--check',$repo.'/public/sgf-stock-catalogue.mjs']))->mustRun();
|
|
$hashes=[];$copy=function($src,$file)use($s,$work,&$hashes){$dest=$s['app'].'/'.$file;$backup=$work.'/before/'.$file;if(is_file($dest)){if(!is_dir(dirname($backup)))mkdir(dirname($backup),0700,true);copy($dest,$backup);}if(!is_dir(dirname($dest)))mkdir(dirname($dest),0700,true);copy($src,$dest);$hashes[$file]=hash_file('sha256',$dest);};foreach($files as$file)$copy($repo.'/'.$file,$file);
|
|
$config=['enabled'=>true,'binding_sha256'=>hash_file('sha256',$s['root'].'/stock-catalogue-binding.json'),'schema_sha256'=>hash_file('sha256',$repo.'/database/sql/stock_catalogue.sql')];$file=$work.'/stock_catalogue.php';file_put_contents($file,"<?php\nreturn ".var_export($config,true).";\n");$copy($file,'config/stock_catalogue.php');
|
|
$build=$run['root'].'/private/single-stock-catalogue-build-20261110';$manifest=json_decode(file_get_contents($build.'/manifest.json'),true);$assets=[];foreach($manifest as$entry){$assets[]=$entry['file'];foreach($entry['css']??[]as$file)$assets[]=$file;}foreach(array_unique($assets)as$file){if(!preg_match('~^assets/[a-zA-Z0-9_.-]+$~D',$file))throw new LogicException('Asset path invalid');$copy($build.'/'.$file,'public/build/'.$file);}$copy($build.'/manifest.json','public/build/manifest.json');file_put_contents($work.'/stock-catalogue-installation.json',json_encode(['passed'=>true,'hashes'=>$hashes,'new_demo'=>false,'cache_cleared'=>false,'native_movements'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/stock-catalogue-installation.json']).PHP_EOL;
|