You are here

function module_builder_get_module_files in Module Builder 6.2

Helper function to get all the code files for a given module TODO: does drush have this?

Parameters

$module_root_name: The root name of a module, eg 'node', 'taxonomy'.

Return value

A flat array of filenames.

2 calls to module_builder_get_module_files()
module_builder_callback_doc_hooks in drush/module_builder.drush.inc
Callback to add doc headers to existing hooks.
module_builder_callback_hook_analyze in drush/module_builder.drush.inc
Callback to list hook implementations found in a given module.

File

includes/common.inc, line 224
common.inc Stuff needed both by module and drush command.

Code

function module_builder_get_module_files($module_root_name) {
  $filepath = drupal_get_path('module', $module_root_name);

  //$old_dir = getcwd();

  //chdir($filepath);
  $files = scandir($filepath);
  foreach ($files as $filename) {
    $ext = substr(strrchr($filename, '.'), 1);
    if (in_array($ext, array(
      'module',
      'install',
      'inc',
    ))) {
      $module_files[] = $filepath . '/' . $filename;
    }
  }
  return $module_files;
}