Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c3447eb

Browse filesBrowse files
committed
[Process] allow writing "prepared" command line.
1 parent 17170ed commit c3447eb
Copy full SHA for c3447eb

File tree

1 file changed

+13
-0
lines changed
Filter options

1 file changed

+13
-0
lines changed

‎components/process.rst

Copy file name to clipboardExpand all lines: components/process.rst
+13Lines changed: 13 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.