install_profile_info
- Versions
- 7
install_profile_info($profile, $locale = 'en')
Retrieve info about an install profile from its .info file.
Information stored in the profile.info file:
- name: The real name of the install profile for display purposes.
- description: A brief description of the profile.
- dependencies: An array of shortnames of other modules this install profile requires.
Example of .info file: @verbatim name = Drupal (minimal) description = Create a Drupal site with only required modules enabled. dependencies[] = block dependencies[] = dblog @endverbatim
Parameters
profile Name of profile.
locale Name of locale used (if any).
Return value
The info array.
Code
includes/install.inc, line 1085
<?php
function install_profile_info($profile, $locale = 'en') {
$cache = &drupal_static(__FUNCTION__, array());
if (!isset($cache[$profile])) {
// Set defaults for module info.
$defaults = array(
'dependencies' => array(),
'description' => '',
'version' => NULL,
'php' => DRUPAL_MINIMUM_PHP,
);
$info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults;
$info['dependencies'] = array_unique(array_merge(
drupal_required_modules(),
$info['dependencies'],
($locale != 'en' && !empty($locale) ? array('locale') : array()))
);
// drupal_required_modules() includes the current profile as a dependency.
// Since a module can't depend on itself we remove that element of the array.
array_shift($info['dependencies']);
$cache[$profile] = $info;
}
return $cache[$profile];
}
?>Login or register to post comments 