function module_builder_get_doc_files in Module Builder 5
Same name and namespace in other branches
- 6.2 includes/process.inc \module_builder_get_doc_files()
- 7 includes/process.inc \module_builder_get_doc_files()
Retrieve list of documentation files containing hook definitions.
Parameters
string $path: Path to the hooks documentation directory
Return value
array Array of files
1 call to module_builder_get_doc_files()
- module_builder_get_hook_data in ./
module_builder.module - Retrieves hook data from downloaded files.
File
- ./
module_builder.module, line 1035 - Builds scaffolding for custom modules.
Code
function module_builder_get_doc_files($path) {
if (!$path) {
drupal_set_message(t('Please configure the hook documentation path in <a href="!settings">module builder settings</a>.', array(
'!settings' => url('admin/settings/module_builder'),
)), 'error');
return NULL;
}
$files = array();
if (is_dir($path)) {
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
// Ignore files that don't make sense to include
if ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'install.php') {
$files[] = $file;
}
}
closedir($dh);
}
else {
drupal_set_message(t('There was an error opening the hook documentation path. Please try again.'), 'error');
return NULL;
}
}
else {
drupal_set_message(t('Hook documentation path is invalid. Please return to the <a href="!settings">module builder settings</a> page to try again.', array(
'!settings' => url('admin/settings/module_builder'),
)), 'error');
return NULL;
}
return $files;
}