You are here

function search_files_get_helpers in Search Files 6.2

Same name and namespace in other branches
  1. 5 search_files.module \search_files_get_helpers()
  2. 7.2 search_files.module \search_files_get_helpers()

get an array of helper programs

Return value

$helpers = array($helper->extension => $helper->helper_path);

2 calls to search_files_get_helpers()
search_files_attachments_get_file_contents in ./search_files_attachments.module
get the file contents using the helpers configured in the search_files_module
search_files_directories_update_index in ./search_files_directories.module
Implementation of hook_update_index().

File

./search_files.module, line 194
Used to index files in attachments and directories

Code

function search_files_get_helpers() {

  // Get all the registered helper applications and put them in static variable to elimiate unnecessary db queries
  // in search_files_nodeapi(). The query log feature of the dev module pointed out that this query was done
  // many times instead of once. Making $helpers a static variable reduced the number of queries by 25%.
  static $helpers;
  if (!isset($helpers)) {
    $helpers = array();
    $result = db_query("SELECT * FROM {search_files_helpers}");
    while ($helper = db_fetch_object($result)) {
      $helpers[$helper->extension] = $helper->helper_path;
    }
  }
  return $helpers;
}