3 lines
884 B
PHP
3 lines
884 B
PHP
<?php
|
|
$s=json_decode(file_get_contents(getenv('RECEIPT_COMPOSITION_STATE')),true);if(!($s['invoices']??false)||is_file($s['root'].'/invoice-writer.json'))throw new LogicException('New invoice writer probe required');require $s['app'].'/vendor/autoload.php';$app=require $s['app'].'/bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();$out=[];foreach(['BudgetContext','BudgetControl','BudgetFailure']as$name){$r=new ReflectionClass('Tempo\Finance\Budget'.chr(92).$name);$out[$name]=['sha256'=>hash_file('sha256',$r->getFileName()),'scope'=>str_starts_with(str_replace('\\','/',realpath($r->getFileName())),str_replace('\\','/',$s['app']).'/')?'private_composition':'workspace'];}file_put_contents($s['root'].'/invoice-writer.json',json_encode(['passed'=>true,'classes'=>$out,'financial_commands_executed'=>0],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
|