Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor(remoteProcess): remove file transfer handling from remote_process and instant_remote_process functions to simplify code

Andras Bacsai60e31a13815a
diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php
index b4f64514b4..56386a55f5 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);
}