class drush_outputformat_csv_or_string

  1. 8.0.x commands/core/outputformat/csv_or_string.inc drush_outputformat_csv_or_string
  2. 6.x commands/core/outputformat/csv_or_string.inc drush_outputformat_csv_or_string
  3. 7.x commands/core/outputformat/csv_or_string.inc drush_outputformat_csv_or_string
  4. master commands/core/outputformat/csv_or_string.inc drush_outputformat_csv_or_string

Output formatter 'csv-or-string'

Hierarchy

Expanded class hierarchy of drush_outputformat_csv_or_string

Members

File

commands/core/outputformat/csv_or_string.inc, line 13

View source
class drush_outputformat_csv_or_string extends drush_outputformat {
  function format($data, $metadata) {
    // If the data is an array, print it as a comma-separated list
    if (is_array($data)) {
      return drush_format($data, $metadata, 'csv');
    }
    return (string) $data;
  }
}