Skip to content

Navigation Menu

Sign in
Appearance settings

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 a316cd5

Browse filesBrowse files
committed
feature #11802 [Process] allow writing "prepared" command line. (Simperfit)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead (closes #11802). Discussion ---------- [Process] allow writing "prepared" command line. This documents the re-pushed prepared command line with a new style of writing it that does not break anything. symfony/symfony#32126 Commits ------- 05f8941 [Process] allow writing "prepared" command line.
2 parents cdc0bb7 + 05f8941 commit a316cd5
Copy full SHA for a316cd5

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.