Created
November 14, 2016 10:21
-
-
Save init90/c40845cd3891d08669b419d48033a969 to your computer and use it in GitHub Desktop.
drupal 7, get information from module info file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get information from module info file. | |
* | |
* @param string $path_to_module | |
* @param string $module_name | |
* | |
* @return array $module_info; | |
*/ | |
function bartik_get_module_info($path_to_module, $module_name) { | |
$path_to_info_file = "{$path_to_module}/{$module_name}.info"; | |
$module_info = drupal_parse_info_file($path_to_info_file); | |
return !empty($module_info) ? $module_info : array(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment