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.

▾ 4 functions call install_profile_info()

drupal_check_profile in includes/install.inc
Check an install profile's requirements.
install_load_profile in ./install.php
Installation task; load information about the chosen profile.
install_select_profile_form in ./install.php
Form API array definition for the profile selection form.
system_requirements in modules/system/system.install
Test and report Drupal installation requirements.

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
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.