You are here

function _asa_get_file_helper_command in Apache Solr Attachments 5

Get the command to parse text out of a particular mime type.

1 call to _asa_get_file_helper_command()
_asa_get_attachment_text in ./apachesolr_attachments.module
Parse the Attachment getting just the raw text, stripping any garbage characters that could screw up the XML Doc processing.

File

./apachesolr_attachments.module, line 292
Provides a file attachment search implementation for use with the Apache Solr module

Code

function _asa_get_file_helper_command($type) {

  // Determine helper based on file extension
  switch ($type) {
    case 'application/pdf':
      $cmd = variable_get('apachesolr_attachment_pdf_path', '');
      break;
    case 'text/plain':
      $cmd = variable_get('apachesolr_attachment_txt_path', '');
      break;
    case 'application/msword':
      $cmd = variable_get('apachesolr_attachment_doc_path', '');
      break;
    default:
      $cmd = '';
  }
  return $cmd;
}