Skip to content

Commit

Permalink
Allow CmdExecuteService the execute commands passed as arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-vessey committed Jan 3, 2025
1 parent d44a487 commit 8afe115
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CmdExecuteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ public function execute($cmd, $data): \Closure
$pipes = [];

// Start process, telling it to use STDIN for input and STDOUT for output.
$cmd = escapeshellcmd($cmd);
$cmd = match (gettype($cmd)) {
'array' => $cmd,
default => escapeshellcmd($cmd),
};
$process = proc_open($cmd, $descr, $pipes);

// Get the data into pipe only if data is resource
Expand Down

0 comments on commit 8afe115

Please sign in to comment.