Skip to content

Commit c3447eb

Browse files
committed
[Process] allow writing "prepared" command line.
1 parent 17170ed commit c3447eb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/process.rst

+13
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,19 @@ instead::
350350
);
351351
$process->run();
352352

353+
Using a Prepared Command Line
354+
--------------------------------
355+
356+
This component also provides a way to use the process command with prepared using the double brackets notations:
357+
Which means that you can use placeholder in order to have a process that can be changed only with the values and without changing the php code.
358+
The component will not escape the characters, you are responsible of doing so::
359+
360+
use Symfony\Component\Process\Process;
361+
362+
$process = Process::fromShellCommandline('echo "$name"');
363+
$process->run(null, ['name' => 'elsa']);
364+
365+
353366
Process Timeout
354367
---------------
355368

0 commit comments

Comments
 (0)