File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -350,6 +350,27 @@ instead::
350350 );
351351 $process->run();
352352
353+ Using a Prepared Command Line
354+ -----------------------------
355+
356+ You can run the process by using a a prepared command line using the
357+ double bracket notation. You can use a placeholder in order to have a
358+ process that can only be changed with the values and without changing
359+ the PHP code::
360+
361+ use Symfony\Component\Process\Process;
362+
363+ $process = Process::fromShellCommandline('echo "$name"');
364+ $process->run(null, ['name' => 'Elsa']);
365+
366+ .. caution ::
367+
368+ A prepared command line will not be escaped automatically!
369+
370+ .. versionadded :: 4.4
371+
372+ Prepared command lines were introduced in Symfony 4.4.
373+
353374Process Timeout
354375---------------
355376
You can’t perform that action at this time.
0 commit comments