19 lines
860 B
PHP
19 lines
860 B
PHP
<?php
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\{AirportDomains,SiteMode};
|
|
use Illuminate\Console\Command;
|
|
|
|
final class VerifyDomainHub extends Command
|
|
{
|
|
protected $signature='domainhub:verify';
|
|
protected $description='Verify that the application reads the current public domain snapshot';
|
|
public function handle(): int
|
|
{
|
|
$s=AirportDomains::snapshot();
|
|
if (! $s || (int)getenv('DOMAINHUB_EXPECT_VERSION') !== ($s['manifest']['version']??null)) return self::FAILURE;
|
|
$this->line(json_encode(['version'=>$s['manifest']['version'],'enabled'=>(bool)config('domainhub.enabled'),'quiet'=>SiteMode::quiet(),'banners'=>collect(config('advertising'))->map(fn($p)=>(bool)$p['enabled'])->all(),'recommendations'=>(bool)config('airport_recommendations.enabled')],JSON_THROW_ON_ERROR));
|
|
return self::SUCCESS;
|
|
}
|
|
}
|