install_profile_info

7 install.inc install_profile_info($profile, $locale = 'en')
8 install.inc install_profile_info($profile, $langcode = 'en')

Retrieve info about an install 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:

  • 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.

Additional, less commonly-used information that can appear in a profile.info file but not in a normal Drupal module .info file includes:

  • distribution_name: The name of the Drupal distribution that is being installed, to be shown throughout the installation process. Defaults to 'Drupal'.

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

Parameters

$profile: Name of profile.

$locale: Name of locale used (if any).

Return value

The info array.

6 calls to install_profile_info()

File

includes/install.inc, line 1255

Code

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' => '', 
      'distribution_name' => 'Drupal', 
      'version' => NULL, 
      'hidden' => FALSE, 
      '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