function drush_backend_output_discard

8.0.x backend.inc drush_backend_output_discard($string)
6.x backend.inc drush_backend_output_discard($string)
7.x backend.inc drush_backend_output_discard($string)
5.x backend.inc drush_backend_output_discard($string)
master backend.inc drush_backend_output_discard($string)

Output buffer functions that discards all output but backend packets.

1 string reference to 'drush_backend_output_discard'

File

includes/backend.inc, line 199
Drush backend API

Code

function drush_backend_output_discard($string) {
  $packet_regex = strtr(sprintf(DRUSH_BACKEND_PACKET_PATTERN, "([^\0]*)"), array("\0" => "\\0"));
  $packet_regex = str_replace("\n", "", $packet_regex);
  if (preg_match_all("/$packet_regex/s", $string, $matches)) {
    return implode('', $matches[0]);
  }
}