? drushrc.php ? profiles/default/.default.info.swp ? profiles/default/default.install ? profiles/expert/.expert.info.swp ? profiles/expert/.expert.profile.swp ? sites/head.dev ? sites/default/files Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.181 diff -u -p -r1.181 install.php --- install.php 30 Jun 2009 21:44:06 -0000 1.181 +++ install.php 3 Jul 2009 14:34:34 -0000 @@ -102,8 +102,6 @@ function install_main() { install_no_profile_error(); } - // Load the profile. - require_once DRUPAL_ROOT . "/profiles/$profile/$profile.profile"; // Locale selection if (!empty($_GET['locale'])) { @@ -113,6 +111,8 @@ function install_main() { install_goto("install.php?profile=$profile&locale=$install_locale"); } + $info = install_profile_info($profile, $install_locale); + // Tasks come after the database is set up if (!$task) { global $db_url; @@ -151,7 +151,7 @@ function install_main() { // Save the list of other modules to install for the 'profile-install' // task. variable_set() can be used now that system.module is installed // and drupal is bootstrapped. - $modules = drupal_get_profile_modules($profile, $install_locale); + $modules = $info['dependencies']; variable_set('install_profile_modules', array_diff($modules, array('system'))); } @@ -437,6 +437,7 @@ function install_select_profile() { } } + /** * Form API array definition for the profile selection form. * @@ -451,12 +452,8 @@ function install_select_profile_form(&$f foreach ($profile_files as $profile) { include_once DRUPAL_ROOT . '/' . $profile->filepath; - - // Load profile details and store them for later retrieval. - $function = $profile->name . '_profile_details'; - if (function_exists($function)) { - $details = $function(); - } + + $details = install_profile_info($profile->name); $profiles[$profile->name] = $details; // Determine the name of the profile; default to file name if defined name @@ -970,15 +967,11 @@ function install_task_list($active = NUL unset($tasks['profile-select']); $tasks['profile-install-batch'] = st('Install site'); } - // Add tasks defined by the profile. if ($profile) { - $function = $profile . '_profile_task_list'; - if (function_exists($function)) { - $result = $function(); - if (is_array($result)) { - $tasks += $result; - } + $info = install_profile_info($profile); + if (array_key_exists('tasks', $info)) { + $tasks += $info['tasks']; } } Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.94 diff -u -p -r1.94 install.inc --- includes/install.inc 28 Jun 2009 03:56:43 -0000 1.94 +++ includes/install.inc 3 Jul 2009 14:34:35 -0000 @@ -422,24 +422,6 @@ function drupal_get_install_files($modul return $installs; } -/** - * Get a list of modules required by an installation profile. - * - * @param profile - * Name of profile. - * @param locale - * Name of locale used (if any). - * @return - * The list of modules to install. - */ -function drupal_get_profile_modules($profile, $locale = 'en') { - $profile_file = "./profiles/$profile/$profile.profile"; - require_once($profile_file); - - // Get a list of modules required by this profile. - $function = $profile . '_profile_modules'; - return array_merge(drupal_required_modules(), $function(), ($locale != 'en' && !empty($locale) ? array('locale') : array())); -} /** * Verify an install profile for installation. @@ -460,8 +442,8 @@ function drupal_verify_profile($profile, if (!isset($profile) || !file_exists($profile_file)) { install_no_profile_error(); } + $info = install_profile_info($profile); - $module_list = drupal_get_profile_modules($profile, $locale); // Get a list of modules that exist in Drupal's assorted subdirectories. $present_modules = array(); @@ -470,7 +452,7 @@ function drupal_verify_profile($profile, } // Verify that all of the profile's required modules are present. - $missing_modules = array_diff($module_list, $present_modules); + $missing_modules = array_diff($info['dependencies'], $present_modules); $requirements = array(); @@ -924,14 +906,10 @@ function drupal_check_profile($profile) install_no_profile_error(); } - require_once $profile_file; - - // Get a list of modules required by this profile. - $function = $profile . '_profile_modules'; - $module_list = array_unique(array_merge(drupal_required_modules(), $function())); + $info = install_profile_info($profile); // Get a list of all .install files. - $installs = drupal_get_install_files($module_list); + $installs = drupal_get_install_files($info['dependencies']); // Collect requirement testing results $requirements = array(); @@ -996,3 +974,28 @@ function drupal_check_module($module) { } return TRUE; } + +/** + * Retrieve info about an install profile from it's .info file. + */ +function install_profile_info($profile, $locale = 'en') { + $cache =& drupal_static('install_profile_info', array(), TRUE); + // Set defaults for module info. + $defaults = array( + 'dependencies' => array(), + 'dependents' => array(), + 'description' => '', + 'package' => 'Other', + 'version' => NULL, + 'php' => DRUPAL_MINIMUM_PHP, + 'files' => array(), + ); + $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; +} + Index: profiles/default/default.info =================================================================== RCS file: profiles/default/default.info diff -N profiles/default/default.info --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ profiles/default/default.info 3 Jul 2009 14:34:37 -0000 @@ -0,0 +1,14 @@ +; $Id$ +name = Drupal +description = Create a Drupal site with the most commonly used features pre-installed. +package = Core +version = VERSION +core = 7.x +dependencies[] = block +dependencies[] = color +dependencies[] = comment +dependencies[] = help +dependencies[] = menu +dependencies[] = path +dependencies[] = taxonomy +dependencies[] = dblog Index: profiles/default/default.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v retrieving revision 1.51 diff -u -p -r1.51 default.profile --- profiles/default/default.profile 27 Jun 2009 17:32:00 -0000 1.51 +++ profiles/default/default.profile 3 Jul 2009 14:34:37 -0000 @@ -2,43 +2,6 @@ // $Id: default.profile,v 1.51 2009/06/27 17:32:00 webchick Exp $ /** - * Return an array of the modules to be enabled when this profile is installed. - * - * @return - * An array of modules to enable. - */ -function default_profile_modules() { - return array('block', 'color', 'comment', 'help', 'menu', 'path', 'taxonomy', 'dblog', 'search'); -} - -/** - * Return a description of the profile for the initial installation screen. - * - * @return - * An array with keys 'name' and 'description' describing this profile, - * and optional 'language' to override the language selection for - * language-specific profiles. - */ -function default_profile_details() { - return array( - 'name' => 'Drupal', - 'description' => 'Create a Drupal site with the most commonly used features pre-installed.' - ); -} - -/** - * Return a list of tasks that this profile supports. - * - * @return - * A keyed array of tasks the profile will perform during - * the final stage. The keys of the array will be used internally, - * while the values will be displayed to the user in the installer - * task list. - */ -function default_profile_task_list() { -} - -/** * Perform any final installation tasks for this profile. * * The installer goes through the profile-select -> locale-select @@ -52,20 +15,25 @@ function default_profile_task_list() { * machine here to walk the user through those tasks. First time, * this function gets called with $task set to 'profile', and you * can advance to further tasks by setting $task to your tasks' - * identifiers, used as array keys in the hook_profile_task_list() - * above. You must avoid the reserved tasks listed in - * install_reserved_tasks(). If you implement your custom tasks, - * this function will get called in every HTTP request (for form - * processing, printing your information screens and so on) until - * you advance to the 'profile-finished' task, with which you - * hand control back to the installer. Each custom page you - * return needs to provide a way to continue, such as a form + * identifiers, used as array keys in the tasks property of the + * profilename.info file. + * + * You must avoid the reserved tasks listed in install_reserved_tasks(). + * If you implement your custom tasks, this function will get called in + * every HTTP request (for form processing, printing your information + * screens and so on) until you advance to the 'profile-finished' task, + * with which you hand control back to the installer. Each custom page + * you return needs to provide a way to continue, such as a form * submission or a link. You should also set custom page titles. * * You should define the list of custom tasks you implement by - * returning an array of them in hook_profile_task_list(), as these + * specifying an array of tasks in your profilename.info file, as these * show up in the list of tasks on the installer user interface. * + * Example : + * task[custom_task] = My first custom task + * task[custom_task_2] = My second custom task + * * Remember that the user will be able to reload the pages multiple * times, so you might want to use variable_set() and variable_get() * to remember your data and control further processing, if $task Index: profiles/expert/expert.info =================================================================== RCS file: profiles/expert/expert.info diff -N profiles/expert/expert.info --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ profiles/expert/expert.info 3 Jul 2009 14:34:37 -0000 @@ -0,0 +1,8 @@ +; $Id$ +name = Drupal (minimal) +description = Create a Drupal site with only required modules enabled. +package = Core +version = VERSION +core = 7.x +dependencies[] = block +dependencies[] = dblog Index: profiles/expert/expert.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/expert/expert.profile,v retrieving revision 1.9 diff -u -p -r1.9 expert.profile --- profiles/expert/expert.profile 27 May 2009 18:34:02 -0000 1.9 +++ profiles/expert/expert.profile 3 Jul 2009 14:34:37 -0000 @@ -2,43 +2,6 @@ // $Id: expert.profile,v 1.9 2009/05/27 18:34:02 dries Exp $ /** - * Return an array of the modules to be enabled when this profile is installed. - * - * @return - * An array of modules to enable. - */ -function expert_profile_modules() { - return array('block', 'dblog'); -} - -/** - * Return a description of the profile for the initial installation screen. - * - * @return - * An array with keys 'name' and 'description' describing this profile, - * and optional 'language' to override the language selection for - * language-specific profiles. - */ -function expert_profile_details() { - return array( - 'name' => 'Drupal (minimal)', - 'description' => 'Create a Drupal site with only required modules enabled.' - ); -} - -/** - * Return a list of tasks that this profile supports. - * - * @return - * A keyed array of tasks the profile will perform during - * the final stage. The keys of the array will be used internally, - * while the values will be displayed to the user in the installer - * task list. - */ -function expert_profile_task_list() { -} - -/** * Perform any final installation tasks for this profile. */ function expert_profile_tasks(&$task, $url) {