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

[Process] allow writing "prepared" command line. #9295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions 12 components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,18 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and

However, it is possible to pass a callback to the ``start``, ``run`` or ``mustRun``
methods to handle process output in a streaming fashion.

Using the prepared command lines
--------------------------------

This components also provides a way to use the process command with prepared using the double brackets notations:

use Symfony\Component\Process\Process;

$process = new Process('/usr/bin/php {{ phpFile }}');
$process->run(null, array('phpFile' => 'worker.php'));

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be noted whether the user of this api is still responsible to escape the passed in data or whether the console component will take care of escaping (e.g. > character or similar)


Finding the Executable PHP Binary
---------------------------------
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.