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

7 lines
1.8 KiB
PHP

<?php
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';$files=['app/Modules/Workshop/WorkshopEquipment.php','app/Modules/Workshop/Http/WorkshopEquipmentController.php','app/Modules/Workshop/WorkshopSchedule.php','app/Modules/Workshop/Http/WorkshopScheduleController.php','app/Shared/Installation/PresentationEntry.php','app/Shared/Context/ModuleNavigation.php','app/Modules/Identity/Services/IdentityWorkflow.php','routes/web.php'];$hashes=[];
$copy=function($source,$file)use($s,$work,&$hashes){$target=$s['app'].'/'.$file;$before=$work.'/before/'.$file;if(is_file($target)){if(!is_dir(dirname($before)))mkdir(dirname($before),0700,true);copy($target,$before);}if(!is_dir(dirname($target)))mkdir(dirname($target),0700,true);copy($source,$target);$hashes[$file]=hash_file('sha256',$target);};
foreach($files as $file)(new Symfony\Component\Process\Process([PHP_BINARY,'-l',$repo.'/'.$file]))->mustRun();foreach($files as $file)$copy($repo.'/'.$file,$file);
$file=$work.'/workshop_schedule.php';file_put_contents($file,"<?php\nreturn ['enabled'=>true];\n");$copy($file,'config/workshop_schedule.php');$copy($file,'config/workshop_catalogue.php');$build=$run['root'].'/private/single-schedule-ui-build-20261110';if(!is_file($build.'/manifest.json'))throw new LogicException('Validated build required');foreach(glob($build.'/assets/*') as $file)$copy($file,'public/build/assets/'.basename($file));$copy($build.'/manifest.json','public/build/manifest.json');
file_put_contents($work.'/workshop-schedule-installation.json',json_encode(['passed'=>true,'source_hashes'=>$hashes,'installation'=>$tag,'new_grants'=>0,'cache_cleared'=>false,'new_demo'=>false,'sgc_enabled'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/workshop-schedule-installation.json']).PHP_EOL;