diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-19 04:48:10 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-19 04:48:10 +0000 |
commit | 48e41d314e7ed278f131e705fbfd0dd6b766a83d (patch) | |
tree | 3f23becc9c1a8846d2964b78d30b0f168cfbcfa9 /includes/install.inc | |
parent | 3ccd437530bac14be8bdc3e3a503930d77aedd96 (diff) | |
download | brdo-48e41d314e7ed278f131e705fbfd0dd6b766a83d.tar.gz brdo-48e41d314e7ed278f131e705fbfd0dd6b766a83d.tar.bz2 |
#509392 follow-up by adrian: Clean-up for .info files for install profiles patch.
Diffstat (limited to 'includes/install.inc')
-rw-r--r-- | includes/install.inc | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/includes/install.inc b/includes/install.inc index 70ab3c709..e3233946e 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -977,23 +977,49 @@ function drupal_check_module($module) { /** * 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. + * - tasks: An associative array of tasks and the page title of each task that need to be + * completed for installation. + * + * Example of .info file: + * @verbatim + * name = Drupal (minimal) + * description = Create a Drupal site with only required modules enabled. + * dependencies[] = block + * dependencies[] = dblog + * @endverbatim + * + * @param profile + * Name of profile. + * @param locale + * Name of locale used (if any). + * @return + * The info array. */ function install_profile_info($profile, $locale = 'en') { - $cache =& drupal_static('install_profile_info', array(), TRUE); - // Set defaults for module info. - $defaults = array( - 'dependencies' => array(), - 'tasks' => array(), - 'description' => '', - 'version' => NULL, - 'php' => DRUPAL_MINIMUM_PHP, - ); - $info = drupal_parse_info_file(sprintf('profiles/%s/%s.info', $profile, $profile)) + $defaults; - $info['dependencies'] = array_unique(array_merge( - drupal_required_modules(), - $info['dependencies'], - ($locale != 'en' && !empty($locale) ? array('locale') : array())) - ); - return $info; + $cache = &drupal_static(__FUNCTION__, array()); + + if (!isset($cache[$profile])) { + // Set defaults for module info. + $defaults = array( + 'dependencies' => array(), + 'tasks' => 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())) + ); + $cache[$profile] = $info; + } + return $cache[$profile]; } |