You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), E_USER_DEPRECATED);
thrownew \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should an array whose first is element is either the path to the binary to run of a "Process" object.', __METHOD__));
50
65
}
51
66
52
67
if ($verbosity <= $output->getVerbosity()) {
@@ -57,7 +72,7 @@ public function run(OutputInterface $output, $cmd, $error = null, callable $call
@@ -51,9 +52,13 @@ public function __construct(string $script, string $cwd = null, array $env = nul
51
52
52
53
/**
53
54
* Sets the path to the PHP binary to use.
55
+
*
56
+
* @deprecated since Symfony 4.2, use the $php argument of the constructor instead.
54
57
*/
55
58
publicfunctionsetPhpBinary($php)
56
59
{
60
+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the $php argument of the constructor instead.', __METHOD__), E_USER_DEPRECATED);
thrownewRuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
144
144
}
145
145
146
-
$this->commandline = $commandline;
146
+
if (!\is_array($command)) {
147
+
@trigger_error(sprintf('Passing a command as string when creating a "%s" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::withShell()" constructor if you need features provided by the shell.', __CLASS__), E_USER_DEPRECATED);
148
+
}
149
+
150
+
$this->commandline = $command;
147
151
$this->cwd = $cwd;
148
152
149
153
// on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started
@@ -163,6 +167,23 @@ public function __construct($commandline, string $cwd = null, array $env = null,
163
167
$this->pty = false;
164
168
}
165
169
170
+
/**
171
+
* @param string $command The command line to pass to the shell of the OS
172
+
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
173
+
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
174
+
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
175
+
* @param int|float|null $timeout The timeout in seconds or null to disable
176
+
*
177
+
* @throws RuntimeException When proc_open is not installed
0 commit comments