I am upgrading an old Symfony application (v2.8) to Symfony 5.3. I am using the process component where the arguments have to be passed in another way than before.
My previous code was like
use Symfony\Component\Process\Process;
$cmd = sprintf('mysqldump mydatabase > %s', $outputTarget);
$process = new Process($cmd);
$process->run();
Now, Symfony's Process constructor expects the binary and the arguments to be passed as array (see here).
How can I achieve the output redirection with the new style?
$process = new Process(['mysqldump', 'mydatabase', '>', $outputTarget]);
$process->run();
Won't work, because the >
would be escaped.