From 60e31a13815a0e83439c946521e11e89ba802079 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:59:35 +0200 Subject: [PATCH] refactor(remoteProcess): remove file transfer handling from remote_process and instant_remote_process functions to simplify code --- bootstrap/helpers/remoteProcess.php | 34 ----------------------------- 1 file changed, 34 deletions(-) diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php index b4f64514b..56386a55f 100644 --- a/bootstrap/helpers/remoteProcess.php +++ b/bootstrap/helpers/remoteProcess.php @@ -29,23 +29,6 @@ function remote_process( $type = $type ?? ActivityTypes::INLINE->value; $command = $command instanceof Collection ? $command->toArray() : $command; - // Process commands and handle file transfers - $processed_commands = []; - foreach ($command as $cmd) { - if (is_array($cmd) && isset($cmd['transfer_file'])) { - // Handle file transfer command - $transfer_data = $cmd['transfer_file']; - $content = $transfer_data['content']; - $destination = $transfer_data['destination']; - - // Execute file transfer immediately - transfer_file_to_server($content, $destination, $server, ! $ignore_errors); - } else { - // Regular string command - $processed_commands[] = $cmd; - } - } - if ($server->isNonRoot()) { $command = parseCommandsByLineForSudo(collect($command), $server); } @@ -197,23 +180,6 @@ function instant_remote_process(Collection|array $command, Server $server, bool { $command = $command instanceof Collection ? $command->toArray() : $command; - // Process commands and handle file transfers - $processed_commands = []; - foreach ($command as $cmd) { - if (is_array($cmd) && isset($cmd['transfer_file'])) { - // Handle file transfer command - $transfer_data = $cmd['transfer_file']; - $content = $transfer_data['content']; - $destination = $transfer_data['destination']; - - // Execute file transfer immediately - transfer_file_to_server($content, $destination, $server, $throwError); - } else { - // Regular string command - $processed_commands[] = $cmd; - } - } - if ($server->isNonRoot() && ! $no_sudo) { $command = parseCommandsByLineForSudo(collect($command), $server); }