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

4 lines
2.0 KiB
PHP

<?php
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';$files=['app/Modules/Finance/CashWorkspace.php','app/Modules/Finance/Http/CashController.php','app/Modules/Accounting/CashLedgerSource.php','app/Modules/Accounting/ComposedLedger.php','app/Modules/Accounting/ComposedLedgerCandidates.php','app/Modules/Identity/Services/IdentityWorkflow.php','app/Shared/Context/ModuleNavigation.php','app/Shared/Installation/PresentationEntry.php','packages/general-ledger/src/PayableJournal.php','packages/general-ledger/src/LedgerCycle.php','packages/general-ledger/src/LedgerSales.php','routes/web.php','resources/views/finance/cash.blade.php','resources/views/accounting/composed-ledger.blade.php','public/sgf-cash.mjs'];$hashes=[];
$copy=function($source,$file)use($s,$work,&$hashes){$target=$s['app'].'/'.$file;$backup=$work.'/before/'.$file;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($source,$target);$hashes[$file]=hash_file('sha256',$target);};foreach($files as $file)if(str_ends_with($file,'.php')&&!str_ends_with($file,'.blade.php'))(new Symfony\Component\Process\Process([PHP_BINARY,'-l',$repo.'/'.$file]))->mustRun();foreach($files as $file)$copy($repo.'/'.$file,$file);$build=$run['root'].'/private/single-cash-build-20261110';foreach(glob($build.'/assets/*') as $file)$copy($file,'public/build/assets/'.basename($file));$copy($build.'/manifest.json','public/build/manifest.json');$file=$work.'/cash_qa.php';file_put_contents($file,"<?php\nreturn ".var_export(['enabled'=>true,'binding_sha256'=>hash_file('sha256',$s['root'].'/cash-binding.json')],true).";\n");$copy($file,'config/cash_qa.php');file_put_contents($work.'/cash-installation.json',json_encode(['passed'=>true,'source_hashes'=>$hashes,'new_demo'=>false,'cache_cleared'=>false,'public_grants'=>0,'real_activation'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/cash-installation.json']).PHP_EOL;