We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a756380 commit cee2d60Copy full SHA for cee2d60
src/Command.php
@@ -20,14 +20,19 @@ private function __construct()
20
*
21
* @throws \Exception
22
*/
23
- public static function exec($command, array $params = array())
+ public static function exec($command, array $params = array(), $mergeStdErr=true)
24
{
25
if (empty($command)) {
26
throw new \InvalidArgumentException('Command line is empty');
27
}
28
29
$command = self::bindParams($command, $params);
30
31
+ if ($mergeStdErr) {
32
+ // Redirect stderr to stdout to include it in $output
33
+ $command .= ' 2>&1';
34
+ }
35
+
36
exec($command, $output, $code);
37
38
if (count($output) === 0) {
0 commit comments