setTimeout(600); $process->run(); if (! $process->isSuccessful()) { Log::error('new_project failed', [ 'channel_id' => $channelId, 'out' => $process->getOutput(), 'err' => $process->getErrorOutput(), ]); $this->deleteWebTree($channelId); throw new RuntimeException( '生成渠道资源失败: '.trim($process->getErrorOutput() ?: $process->getOutput() ?: 'unknown') ); } } public function deleteWebTree(string $channelId): void { $channelId = strtolower(trim($channelId)); if (! preg_match('/^[a-z0-9]{32}$/', $channelId)) { return; } $dir = public_path('web/'.$channelId); if (is_dir($dir)) { File::deleteDirectory($dir); } } }