failed('APP_INSTALLED 未被 Laravel 加载。', self::EXIT_NOT_INSTALLED); } foreach ([ storage_path('app'), storage_path('framework/views'), storage_path('logs'), base_path('bootstrap/cache'), base_path('.env'), ] as $writablePath) { if (! is_writable($writablePath)) { return $this->failed('Laravel 运行目录不可写。', self::EXIT_RUNTIME_NOT_WRITABLE); } } try { DB::selectOne('SELECT 1'); } catch (Throwable) { return $this->failed('Laravel 数据库连接失败。', self::EXIT_DATABASE_CONNECTION_FAILED); } if ($configuration->current()['mode'] === 'bootstrap') { $this->components->info('本地网页和临时引导库已就绪;团队共享数据尚未接入。'); } else { $this->components->info('应用运行正常,当前数据库可查询。团队数据接入状态请运行 system-database:verify 检查。'); } return self::SUCCESS; } private function failed(string $message, int $exitCode): int { $this->components->error($message); return $exitCode; } }