$root.'/storage/framework/absent-comparison-config.php', 'PGOPTIONS' => '-c default_transaction_read_only=on', 'CACHE_STORE' => 'array', 'SESSION_DRIVER' => 'array'] as $key => $value) { putenv($key.'='.$value); $_ENV[$key] = $_SERVER[$key] = $value; } } elseif (($argv[1] ?? '') !== '--public-read-only') { throw new LogicException('Explicit read-only comparison required'); } $app = require $root.'/bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); DB::statement('SET default_transaction_read_only=on'); $runtime = app(StandaloneRuntime::class); $runtime->configure(DB::connection()); $runtime->assertLoadedPackages(); $features = []; foreach (StandaloneRuntime::FEATURES as $feature) { $features[$feature] = $runtime->requested($feature); } $routes = []; foreach (Route::getRoutes() as $route) { if (str_starts_with($route->uri(), 'avaliar') || str_starts_with($route->uri(), '_')) { continue; } $routes[$route->uri().' '.implode('|', $route->methods())] = $route->getActionName(); } ksort($routes); $components = []; foreach (['standalone-runtime', 'inventory_conversion', 'order_cancellation'] as $key) { $components[$key] = config($key.'.enabled'); } $tenants = DB::table('tenants')->select('work_context_policy')->get()->map(fn ($row) => $row->work_context_policy === null ? null : json_decode($row->work_context_policy, true))->all(); $flags = []; $collectFlags = function (array $values, string $prefix = '') use (&$collectFlags, &$flags): void { foreach ($values as $key => $value) { $path = $prefix.$key; if (is_array($value)) { $collectFlags($value, $path.'.'); } elseif (is_bool($value) && preg_match('/(?:enabled|synthetic_only|prepare_only|enforced)$/D', (string) $key)) { $flags[$path] = $value; } } }; $collectFlags(config()->all()); ksort($flags); echo json_encode(['state' => 'passed', 'runtime_enabled' => $runtime->enabled(), 'features' => $features, 'deployment_flags' => $flags, 'history_schema' => ['pa_history_imports' => Schema::hasTable('pa_history_imports'), 'pa_imported_payments' => Schema::hasTable('pa_imported_payments')], 'pending_application_migrations' => array_values(array_diff(array_map(fn ($file) => basename($file, '.php'), glob($root.'/database/migrations/*.php')), DB::table('migrations')->pluck('migration')->all())), 'routes' => $routes, 'component_flags' => $components, 'company_context_policies' => $tenants, 'context_entitlements_configured' => count(config('work_context.entitlements', [])) > 0, 'operational_contexts' => array_combine(array_keys(WorkContext::OPTIONS), array_map(fn ($key) => WorkContext::operational($key), array_keys(WorkContext::OPTIONS))), 'business_data_changed' => false], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR).PHP_EOL;