drupal_parse_info_file
- Versions
- 6 – 7
drupal_parse_info_file($filename)
Parse Drupal module and theme info file format.
Info files are NOT for placing arbitrary theme and module-specific settings. Use variable_get() and variable_set() for that.
Information stored in a module .info file:
- name: The real name of the module for display purposes.
- description: A brief description of the module.
- dependencies: An array of shortnames of other modules this module requires.
- package: The name of the package of modules this module belongs to.
See also
forum.info
Information stored in a theme .info file:
- name: The real name of the theme for display purposes
- description: Brief description
- screenshot: Path to screenshot relative to the theme's .info file.
- engine: Theme engine, typically: engine = phptemplate
- base: Name of a base theme, if applicable, eg: base = zen
- regions: Listed regions eg: region[left] = Left sidebar
- features: Features available eg: features[] = logo
- stylesheets: Theme stylesheets eg: stylesheets[all][] = my-style.css
- scripts: Theme scripts eg: scripts[] = my-script.css
See also
garland.info
See also
Parameters
$filename The file we are parsing. Accepts file with relative or absolute path.
Return value
The info array.
Code
includes/common.inc, line 5866
<?php
function drupal_parse_info_file($filename) {
if (!file_exists($filename)) {
return array();
}
$data = file_get_contents($filename);
return drupal_parse_info_format($data);
}
?>Login or register to post comments 