You are here

function module_builder_get_functions in Module Builder 6.2

Helper function to get all function names from a file.

Parameters

$file: A complete filename from the Drupal root, eg 'modules/user/user.module'.

1 call to module_builder_get_functions()
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 247
common.inc Stuff needed both by module and drush command.

Code

function module_builder_get_functions($file) {
  $code = file_get_contents($file);

  //drush_print($code);
  $matches = array();
  $pattern = "/^function (\\w+)/m";
  preg_match_all($pattern, $code, $matches);
  return $matches[1];
}