commit compras3 2911
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-29 16:03:11 +02:00
parent 7da8d6c87a
commit 30bfb1a773
72 changed files with 10998 additions and 98 deletions
+16 -4
View File
@@ -27,13 +27,25 @@ class AppServiceProvider extends ServiceProvider
$this->app->scoped(AdministrativeGeography::class);
$this->app->scoped(StandaloneRuntime::class, fn () => new StandaloneRuntime(config('standalone-runtime'), new StandaloneArtifact));
$runtime = $this->app->make(StandaloneRuntime::class);
$loader = $runtime;
$paths = null;
if ($runtime->enabled()) {
$preparing = config('standalone-runtime.prepare_only') === true;
if ($preparing && (! $this->app->runningInConsole() || $runtime->enabled())) {
throw new \LogicException('COMPRAS_RUNTIME_PREPARATION_CONSOLE_ONLY');
}
if ($runtime->enabled() || $preparing) {
if (config('common-finance-bundle.root') !== null || config('budget-distributions.enabled') === true) {
throw new \LogicException('COMPRAS_RUNTIME_MIXED_COMPOSITION');
}
$paths = $runtime->configure(DB::connection());
$runtime->assertLoadedPackages(allowMissing: true);
if ($preparing) {
$settings = config('standalone-runtime');
$settings['enabled'] = true;
$loader = new StandaloneRuntime($settings, new StandaloneArtifact);
$paths = $loader->artifact()['paths'];
} else {
$paths = $runtime->configure(DB::connection());
}
$loader->assertLoadedPackages(allowMissing: true);
config(['common-budget.path' => $paths['budget-control'], 'common-payables.path' => $paths['payables'],
'general-ledger.path' => $paths['general-ledger']]);
}
@@ -49,7 +61,7 @@ class AppServiceProvider extends ServiceProvider
require_once $payables.'/bootstrap.php';
if ($paths !== null) {
require_once $paths['general-ledger'].'/bootstrap.php';
$runtime->assertLoadedPackages();
$loader->assertLoadedPackages();
}
}