_module_parse_info_file
Definition
_module_parse_info_file($filename)
includes/module.inc, line 190
Description
Parse Drupal info file format. Uses ini parser provided by php's parse_ini_file).
Files should use the ini format to specify values. e.g. key = "value" key2 = value2
Some things to be aware of:
- This function is NOT for placing arbitrary module-specific settings. Use variable_get() and variable_set() for that.
- You may not use double-quotes in a value.
Example of .info file: name = Forum description = Enables threaded discussions about general topics. dependencies = taxonomy comment package = Core - optional
Parameters
$filename The file we are parsing. Accepts file with relative or absolute path.
Return value
The info array.
Code
<?php
function _module_parse_info_file($filename) {
$info = array();
if (file_exists($filename)) {
$info = parse_ini_file($filename);
if (isset($info['dependencies'])) {
$info['dependencies'] = explode(" ", $info['dependencies']);
}
else {
$info['dependencies'] = NULL;
}
}
return $info;
}
?> 