From c33d0f7be84eef3f3cd3a6d4855fc315adb3c554 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 13 Jan 2010 05:08:29 +0000 Subject: #399642 follow-up by carlos8f: Replace drupal_install_modules() with an improved module_enable(). --- includes/install.inc | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'includes/install.inc') diff --git a/includes/install.inc b/includes/install.inc index 6f876b2c3..d1496fcbd 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -535,52 +535,6 @@ function drupal_verify_profile($install_state) { return $requirements; } -/** - * Calls the install function for a given list of modules. - * - * @param $module_list - * The modules to install. - * @param $disable_modules_installed_hook - * Normally just testing wants to set this to TRUE. - * - * @return - * TRUE if installation was attempted, FALSE if one or more dependencies are - * missing. - */ -function drupal_install_modules($module_list = array(), $disable_modules_installed_hook = FALSE) { - $files = system_rebuild_module_data(); - $module_list = array_flip(array_values($module_list)); - do { - $moved = FALSE; - foreach ($module_list as $module => $weight) { - $file = $files[$module]; - if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) { - foreach ($file->info['dependencies'] as $dependency) { - if (!isset($module_list[$dependency])) { - if (!isset($files[$dependency])) { - // A dependency was not found, abort installation. - return FALSE; - } - elseif (!$files[$dependency]->status) { - // Add dependencies to $module_list and install them first. - $module_list[$dependency] = $weight - 1; - $moved = TRUE; - } - } - elseif ($module_list[$module] < $module_list[$dependency] +1) { - $module_list[$module] = $module_list[$dependency] +1; - $moved = TRUE; - } - } - } - } - } while ($moved); - asort($module_list); - $module_list = array_keys($module_list); - module_enable($module_list, $disable_modules_installed_hook); - return TRUE; -} - /** * Callback to install an individual install profile module. * -- cgit v1.2.3