function _print_scan_libs in Printer, email and PDF versions 7.2
Auxiliary function to scan all module directories for a given library.
Parameters
string $lib: The machine name of a library to return the path for.
string $mask: The preg_match() regular expression of the files to find.
Return value
array An array of the filenames matching the provided mask.
7 calls to _print_scan_libs()
- hook_print_epub_available_libs_alter in print_epub/
print_epub.api.php - Alters the list of available EPUB libraries.
- hook_print_pdf_available_libs_alter in print_pdf/
print_pdf.api.php - Alters the list of available PDF libraries.
- print_epub_phpepub_print_epub_available_libs_alter in print_epub/
lib_handlers/ print_epub_phpepub/ print_epub_phpepub.module - Implements hook_print_epub_available_libs_alter().
- print_pdf_dompdf_print_pdf_available_libs_alter in print_pdf/
lib_handlers/ print_pdf_dompdf/ print_pdf_dompdf.module - Implements hook_print_pdf_available_libs_alter().
- print_pdf_mpdf_print_pdf_available_libs_alter in print_pdf/
lib_handlers/ print_pdf_mpdf/ print_pdf_mpdf.module - Implements hook_print_pdf_available_libs_alter().
File
- includes/
print.inc, line 21 - Common functions used by several of the print modules.
Code
function _print_scan_libs($lib, $mask) {
$tools = array_keys(file_scan_directory(drupal_get_path('module', 'print'), $mask));
$tools = array_merge($tools, array_keys(file_scan_directory(PRINT_LIB_PATH, $mask)));
if (module_exists('libraries')) {
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path($lib), $mask)));
}
return array_unique($tools);
}