function _drush_backend_print_output

8.0.x _drush_backend_print_output($output_string, $backend_options)
6.x _drush_backend_print_output($output_string, $backend_options)
7.x _drush_backend_print_output($output_string, $backend_options)
5.x _drush_backend_print_output($output_string, $backend_options)
master _drush_backend_print_output($output_string, $backend_options)

Print the output received from a call to backend invoke, adding the label to the head of each line if necessary.

2 calls to _drush_backend_print_output()
_drush_backend_integrate in includes/
Integrate log messages and error statuses into the current process.
_drush_backend_proc_open in includes/
Call an external command using proc_open.


includes/, line 515
Drush backend API


function _drush_backend_print_output($output_string, $backend_options) {
  if ($backend_options['output'] && !empty($output_string)) {
    $output_label = array_key_exists('#output-label', $backend_options) ? $backend_options['#output-label'] : FALSE;
    if (!empty($output_label)) {
      // Remove one, and only one newline from the end of the
      // string. Else we'll get an extra 'empty' line.
      foreach (explode("\n", preg_replace('/\\n$/', '', $output_string)) as $line) {
        fwrite(STDOUT, $output_label . rtrim($line) . "\n");
    else {
      fwrite(STDOUT, $output_string);