Is there any function in Drupal like get_module_info('MODULE_NAME')
or I should parse info
file?
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);
A somewhat easier method (drupal 7 and up) is to use the system_get_info function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With