function search_files_get_helpers in Search Files 7.2
Same name and namespace in other branches
- 5 search_files.module \search_files_get_helpers()
- 6.2 search_files.module \search_files_get_helpers()
Returns an array of helper applications.
Return value
Array whose keys are extensions and values are the paths to helper apps.
3 calls to search_files_get_helpers()
- search_files_attachments_get_file_contents in ./
search_files_attachments.module - Get the file contents using the helpers.
- search_files_directories_update_index in ./
search_files_directories.module - Implements hook_update_index().
- search_files_get_content in ./
search_files.module - return the file text using the appropriate helper
File
- ./
search_files.module, line 221 - Organizes and provides helper functions for extracting text from files.
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}")
->fetchAll();
foreach ($result as $helper) {
$helpers[$helper->extension] = $helper->helper_path;
}
}
return $helpers;
}