I need to execute many commands with Process Component.
$commands = [
["mkdir", "-p", path)],
["cd", path],
["rm", "-f", $archiveName, $sqlDbName . '.sql'],
[$this->dumpCommand($sqlDbName)],
["tar", "zcfP", $archiveName, $sqlDbName . '.sql'],
["rm", "-f", $sqlDbName . ".sql"],
];
foreach ($commands as $command) {
$process = new Process($command);
$process->run();
return $process->getOutput();
}
I think only the first command works. I have no errors. Someone knows why?