diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-21 07:50:08 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-21 07:50:08 +0000 |
commit | 716293e0fbf1155b8e78c4bd2762c98275b8e6cb (patch) | |
tree | a8dd7691cd035f407268e41969ffbb033871bc36 /includes/install.inc | |
parent | d151ea91004abd0c771dfeea380ff4fef0fbf248 (diff) | |
download | brdo-716293e0fbf1155b8e78c4bd2762c98275b8e6cb.tar.gz brdo-716293e0fbf1155b8e78c4bd2762c98275b8e6cb.tar.bz2 |
#509398 by adrian: Turned install profiles into modules with full access to the Drupal API. Almost all WTFs/minute now removed from install profiles. Woohoo! :D
Diffstat (limited to 'includes/install.inc')
-rw-r--r-- | includes/install.inc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/includes/install.inc b/includes/install.inc index 5626196b0..60164b118 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -166,16 +166,12 @@ function drupal_set_installed_schema_version($module, $version) { */ function drupal_install_profile_name() { global $install_state; - $profile = $install_state['parameters']['profile']; - static $name = NULL; - if (!isset($name)) { - // Load profile details. - $function = $profile . '_profile_details'; - if (function_exists($function)) { - $details = $function(); - } - $name = isset($details['name']) ? $details['name'] : 'Drupal'; + if (isset($install_state['profile_info']['name'])) { + $name = $install_state['profile_info']['name']; + } + else { + $name = 'Drupal'; } return $name; @@ -522,6 +518,10 @@ function drupal_verify_profile($install_state) { $present_modules[] = $present_module->name; } + // The install profile is also a module, which needs to be installed after all the other dependencies + // have been installed. + $present_modules[] = drupal_get_profile(); + // Verify that all of the profile's required modules are present. $missing_modules = array_diff($info['dependencies'], $present_modules); @@ -1087,6 +1087,11 @@ function install_profile_info($profile, $locale = 'en') { $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]; |