diff options
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/includes/module.inc b/includes/module.inc index f25331730..fecb9c68a 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -129,6 +129,30 @@ function module_rebuild_cache() { } /** + * Parse Drupal meta file format. + * Uses ini parser provided by php's parse_ini_file(). + * You should not use the meta files to store module specific settings: + * user <code>variable_get()</code> and <code>variable_set()</code> for those. + * + * Files should use the ini format to specify values: + * key = "value" + * key2 = value2 + * + * @param $filename + * The file we are parsing. Accepts file with relative or absolute path. + * @return + * The meta data array. + */ +function module_parse_meta_file($filename) { + $metadata = array(); + + if (file_exists($filename)) { + $metadata = parse_ini_file($filename); + } + return $metadata; +} + +/** * Determine whether a given module exists. * * @param $module |