Files
SGF/scripts/sgf-install-workshop-commercial.php
2026-11-11 09:00:17 +02:00

7 lines
1.2 KiB
PHP

<?php
use Symfony\Component\Process\Process;
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';$build=$run['root'].'/private/single-workshop-commercial-ui-20261110';$files=['app/Modules/Workshop/WorkshopBilling.php'];$hashes=[];
foreach($files as $file)(new Process([PHP_BINARY,'-l',$repo.'/'.$file]))->mustRun();
$copy=function($from,$relative)use($s,$work,&$hashes){$target=$s['app'].'/'.$relative;$backup=$work.'/before/'.$relative;if(is_file($target)){if(!is_dir(dirname($backup)))mkdir(dirname($backup),0700,true);copy($target,$backup);}if(!is_dir(dirname($target)))mkdir(dirname($target),0700,true);copy($from,$target);$hashes[$relative]=hash_file('sha256',$target);};foreach($files as $file)$copy($repo.'/'.$file,$file);foreach(glob($build.'/assets/*') as $asset)$copy($asset,'public/build/assets/'.basename($asset));$copy($build.'/manifest.json','public/build/manifest.json');
file_put_contents($work.'/workshop-commercial-installation.json',json_encode(['passed'=>true,'installation'=>$tag,'source_hashes'=>$hashes,'cache_cleared'=>false,'new_rights'=>0,'new_demo'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/workshop-commercial-installation.json']).PHP_EOL;