Files
compras/app/Console/Commands/PrepareStandaloneRuntime.php
T
nala 30bfb1a773
tests / ci (push) Canceled after 0s
commit compras3 2911
2026-11-29 16:03:11 +02:00

31 lines
1.3 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Services\StandaloneInstallation;
use Illuminate\Console\Command;
final class PrepareStandaloneRuntime extends Command
{
protected $signature = 'compras:runtime:prepare
{--expected-database= : Exact own database name}
{--expected-role= : Exact non-elevated database role}
{--operator= : Named deployment operator}
{--reason= : Recorded installation or recovery reason}
{--apply : Apply the explicitly selected installation}
{--reuse-components : Reuse only complete recognised canonical V1 components; reject partial or changed schemas}
{--rebind : Preserve restored schema and register a new installation binding}';
protected $description = 'Preparar explicitamente a composição independente; pré-visualizar por defeito';
public function handle(StandaloneInstallation $installation): int
{
$result = $installation->prepare((string) $this->option('expected-database'), (string) $this->option('expected-role'),
(string) $this->option('operator'), (string) $this->option('reason'), $this->option('apply') === true, $this->option('rebind') === true,
$this->option('reuse-components') === true);
$this->line(json_encode($result, JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR));
return self::SUCCESS;
}
}