You are here

function search_files_get_helpers in Search Files 5

Same name and namespace in other branches
  1. 6.2 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);

1 call to search_files_get_helpers()
search_files_update_index in ./search_files.module
Implementation of hook_update_index()

File

./search_files.module, line 230
Used to index all files in directory(s) on the server

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 = array();
  $result = db_query('SELECT * FROM {search_files_helpers}');
  while ($helper = db_fetch_object($result)) {
    $helpers[$helper->extension] = $helper->helper_path;
  }
  return $helpers;
}