Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.202 diff -u -p -r1.202 install.php --- install.php 25 Aug 2009 21:53:46 -0000 1.202 +++ install.php 28 Aug 2009 13:06:24 -0000 @@ -997,7 +997,7 @@ function install_settings_form_submit($f * Find all .profile files. */ function install_find_profiles() { - return file_scan_directory('./profiles', '/\.profile$/', array('key' => 'name')); + return drupal_system_listing('/\.profile$/', 'profiles', 'name', 0); } /** @@ -1079,7 +1079,7 @@ function install_select_profile_form(&$f // TODO: is this right? include_once DRUPAL_ROOT . '/' . $profile->uri; - $details = install_profile_info($profile->name); + $details = install_profile_info($profile); $profiles[$profile->name] = $details; // Determine the name of the profile; default to file name if defined name @@ -1259,10 +1259,11 @@ function install_already_done_error() { * the profile cannot be loaded. */ function install_load_profile(&$install_state) { - $profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile'; + $profile = $install_state['profiles'][$install_state['parameters']['profile']]; + $profile_file = DRUPAL_ROOT . '/' . $profile->uri; if (is_file($profile_file)) { include_once $profile_file; - $install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], $install_state['parameters']['locale']); + $install_state['profile_info'] = install_profile_info($profile, $install_state['parameters']['locale']); } else { throw new Exception(st('Sorry, the profile you have chosen cannot be loaded.')); @@ -1473,7 +1474,7 @@ function _install_module_batch($module, * Check installation requirements and report any errors. */ function install_check_requirements($install_state) { - $profile = $install_state['parameters']['profile']; + $profile = $install_state['profiles'][$install_state['parameters']['profile']]; // Check the profile requirements. $requirements = drupal_check_profile($profile); Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.110 diff -u -p -r1.110 install.inc --- includes/install.inc 24 Aug 2009 03:13:44 -0000 1.110 +++ includes/install.inc 28 Aug 2009 13:06:25 -0000 @@ -499,13 +499,13 @@ function drupal_get_install_files($modul * The list of modules to install. */ function drupal_verify_profile($install_state) { - $profile = $install_state['parameters']['profile']; + $profile = $install_state['profiles'][$install_state['parameters']['profile']]; $locale = $install_state['parameters']['locale']; include_once DRUPAL_ROOT . '/includes/file.inc'; include_once DRUPAL_ROOT . '/includes/common.inc'; - $profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile"; + $profile_file = DRUPAL_ROOT . '/' . $profile->uri; if (!isset($profile) || !file_exists($profile_file)) { throw new Exception(install_no_profile_error()); @@ -966,14 +966,14 @@ function st($string, $args = array()) { * Check an install profile's requirements. * * @param $profile - * Name of install profile to check. + * Object of install profile to check.. * @return * Array of the install profile's requirements. */ function drupal_check_profile($profile) { include_once DRUPAL_ROOT . '/includes/file.inc'; - $profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile"; + $profile_file = DRUPAL_ROOT . '/' . $profile->uri; if (!isset($profile) || !file_exists($profile_file)) { throw new Exception(install_no_profile_error()); @@ -1065,7 +1065,7 @@ function drupal_check_module($module) { * @endverbatim * * @param profile - * Name of profile. + * Either the profile name, or the file object returned from install_find_profiles(). * @param locale * Name of locale used (if any). * @return @@ -1074,7 +1074,15 @@ function drupal_check_module($module) { function install_profile_info($profile, $locale = 'en') { $cache = &drupal_static(__FUNCTION__, array()); - if (!isset($cache[$profile])) { + if (is_object($profile)) { + $name = $profile->name; + $path = dirname($profile->uri); + } + else { + $name = $profile; + $path = drupal_get_path('profile', $profile); + } + if (!isset($cache[$name])) { // Set defaults for module info. $defaults = array( 'dependencies' => array(), @@ -1082,7 +1090,7 @@ function install_profile_info($profile, 'version' => NULL, 'php' => DRUPAL_MINIMUM_PHP, ); - $info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults; + $info = drupal_parse_info_file("$path/$name.info") + $defaults; $info['dependencies'] = array_unique(array_merge( drupal_required_modules(), $info['dependencies'], @@ -1093,9 +1101,9 @@ function install_profile_info($profile, // Since a module can't depend on itself we remove that element of the array. array_shift($info['dependencies']); - $cache[$profile] = $info; + $cache[$name] = $info; } - return $cache[$profile]; + return $cache[$name]; } /** Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.778 diff -u -p -r1.778 system.module --- modules/system/system.module 28 Aug 2009 06:42:54 -0000 1.778 +++ modules/system/system.module 28 Aug 2009 13:06:26 -0000 @@ -1845,7 +1845,7 @@ function _system_get_module_data() { // Include the install profile in modules that are loaded. $profile = drupal_get_profile(); $modules[$profile]->name = $profile; - $modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile'; + $modules[$profile]->uri = drupal_get_filename('profile', $profile); $modules[$profile]->filename = $profile . '.profile'; // Install profile hooks are always executed last.