You are here

protected function FeedsCSVParser::getTemplateFileDetails in Feeds 7.2

Gets details about the template file, for the delimiter in the config.

The resulting details indicate the file extension and mime type for the delimiter type.

Parameters

array $config: The configuration for the parser.

Return value

array An array with the following information:

  • 'extension': The file extension for the template ('tsv', 'csv', etc).
  • 'mime-type': The mime type for the template ('text/tab-separated-values', 'text/csv', etc).
1 call to FeedsCSVParser::getTemplateFileDetails()
FeedsCSVParser::getTemplate in plugins/FeedsCSVParser.inc

File

plugins/FeedsCSVParser.inc, line 396
Contains the FeedsCSVParser class.

Class

FeedsCSVParser
Parses a given file as a CSV file.

Code

protected function getTemplateFileDetails(array $config) {
  switch ($config['delimiter']) {
    case 'TAB':
      $extension = 'tsv';
      $mime_type = 'text/tab-separated-values';
      break;
    default:
      $extension = 'csv';
      $mime_type = 'text/csv';
      break;
  }
  return array(
    'extension' => $extension,
    'mime_type' => $mime_type,
  );
}