📌  相关文章
📜  在 laravel 命令中执行 shell 脚本文件 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:48.187000             🧑  作者: Mango

代码示例1
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;

$process = new Process('sh /folder_name/file_name.sh');
$process->run();

// executes after the command finishes
if (!$process->isSuccessful()) {
    throw new ProcessFailedException($process);
}

echo $process->getOutput();