original_string: public static function exec($command, array $params = array(), $mergeStdErr=true)
      {
          if (empty($command)) {
              throw new \InvalidArgumentException('Command line is empty');
          }
  
          $command = self::bindParams($command, $params);
  
          if ($mergeStdErr) {
              // Redirect stderr to stdout to include it in $output
              $command .= ' 2>&1';
          }
  
          exec($command, $output, $code);
  
          if (count($output) === 0) {
              $output = $code;
          } else {
              $output = implode(PHP_EOL, $output);
          }
  
          if ($code !== 0) {
              throw new CommandException($command, $output, $code);
          }
  
          return $output;
      }
code: public static function exec($command, array $params = array(), $mergeStdErr=true)
      {
          if (empty($command)) {
              throw new \InvalidArgumentException('Command line is empty');
          }
  
          $command = self::bindParams($command, $params);
  
          if ($mergeStdErr) {
              // Redirect stderr to stdout to include it in $output
              $command .= ' 2>&1';
          }
  
          exec($command, $output, $code);
  
          if (count($output) === 0) {
              $output = $code;
          } else {
              $output = implode(PHP_EOL, $output);
          }
  
          if ($code !== 0) {
              throw new CommandException($command, $output, $code);
          }
  
          return $output;
      }
code_tokens: public static function exec ( $ command , array $ params = array ( ) , $ mergeStdErr = true ) { if ( empty ( $ command ) ) { throw new \ InvalidArgumentException ( 'Command line is empty' ) ; } $ command = self :: bindParams ( $ command , $ params ) ; if ( $ mergeStdErr ) { // Redirect stderr to stdout to include it in $output $ command .= ' 2>&1' ; } exec ( $ command , $ output , $ code ) ; if ( count ( $ output ) === 0 ) { $ output = $ code ; } else { $ output = implode ( PHP_EOL , $ output ) ; } if ( $ code !== 0 ) { throw new CommandException ( $ command , $ output , $ code ) ; } return $ output ; }
docstring: Execute command with params.
  
  @param string $command
  @param array  $params
  
  @return bool|string
  
  @throws \Exception
docstring_tokens: Execute command with params .