Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal get module info?

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

like image 379
sultan Avatar asked Oct 01 '10 11:10

sultan


2 Answers

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);
like image 142
Scott Reynen Avatar answered Sep 30 '22 13:09

Scott Reynen


A somewhat easier method (drupal 7 and up) is to use the system_get_info function.

like image 40
acrollet Avatar answered Sep 30 '22 14:09

acrollet