From 05f894182a43cd85bee6866bebef552b4e0d2fd7 Mon Sep 17 00:00:00 2001 From: Hamza Amrouche Date: Fri, 21 Jun 2019 09:24:41 +0200 Subject: [PATCH] [Process] allow writing "prepared" command line. --- components/process.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/process.rst b/components/process.rst index 7aecb26302d..8afcf95453b 100644 --- a/components/process.rst +++ b/components/process.rst @@ -350,6 +350,19 @@ instead:: ); $process->run(); +Using a Prepared Command Line +-------------------------------- + +This component also provides a way to use the process command with prepared using the double brackets notations: +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. +The component will not escape the characters, you are responsible of doing so:: + + use Symfony\Component\Process\Process; + + $process = Process::fromShellCommandline('echo "$name"'); + $process->run(null, ['name' => 'elsa']); + + Process Timeout ---------------