drupaldrupal-6

Drupal get module info?


Is there any function in Drupal like get_module_info('MODULE_NAME') or I should parse info file?


Solution

  • drupal_parse_info_file() is the closest function, but it takes a file path, not a module name, so you have to convert the name into the path first:

    $path = drupal_get_path('module', $name) . '/' . $name . '.info';
    $info = drupal_parse_info_file($path);