Retrieves information about an installation profile from its .info file.
The information stored in a profile .info file is similar to that stored in a normal Drupal module .info file. For example:
Additional, less commonly-used information that can appear in a profile.info file but not in a normal Drupal module .info file includes:
Note that this function does an expensive file system scan to get info file information for dependencies. If you only need information from the info file itself, use system_get_info().
Example of .info file:
name = Minimal
description = Start fresh, with only a few modules enabled.
dependencies[] = block
dependencies[] = dblog
$profile: Name of profile.
$langcode: Language code (if any).
The info array.
function install_profile_info($profile, $langcode = 'en') {
$cache =& drupal_static(__FUNCTION__, array());
if (!isset($cache[$profile])) {
// Set defaults for module info.
$defaults = array(
'dependencies' => array(),
'description' => '',
'distribution_name' => 'Drupal',
'version' => NULL,
'hidden' => FALSE,
'php' => DRUPAL_MINIMUM_PHP,
);
$profile_file = drupal_get_path('profile', $profile) . "/{$profile}.info";
$info = drupal_parse_info_file($profile_file);
$info += $defaults;
$info['dependencies'] = array_unique(array_merge(drupal_required_modules(), $info['dependencies'], $langcode != 'en' && !empty($langcode) ? 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];
}