diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 08:28:08 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 08:28:08 +0000 |
commit | 30d7bd56f7b9d22bbbcdfc31bb128c460a986822 (patch) | |
tree | a5026b387c6455c0125005aa9d9a7d306e2624d9 /includes/install.inc | |
parent | 968a51a442059feb4faabbec018970c7cc29a391 (diff) | |
download | brdo-30d7bd56f7b9d22bbbcdfc31bb128c460a986822.tar.gz brdo-30d7bd56f7b9d22bbbcdfc31bb128c460a986822.tar.bz2 |
#93212 by Jaza. Refactor module enabling for greater API avialiablity during hook_enable().
Diffstat (limited to 'includes/install.inc')
-rw-r--r-- | includes/install.inc | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/includes/install.inc b/includes/install.inc index 4c7ed74d2..885a95ff6 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -328,31 +328,26 @@ function drupal_install_profile($profile, $module_list) { /** - * Execute the install scripts for a set of modules. + * Calls the install function and updates the system table for a given list of + * modules. * * @param module_list * The modules to install. */ function drupal_install_modules($module_list = array()) { + $enable_modules = array(); + foreach ($module_list as $module) { - drupal_install_module($module); + if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) { + module_load_install($module); + module_invoke($module, 'install'); + $versions = drupal_get_schema_versions($module); + drupal_set_installed_schema_version($module, $versions ? max($versions) : SCHEMA_INSTALLED); + $enable_modules[] = $module; + } } -} -/** - * Calls the install function and updates the system table for a given module. - * - * @param module - * The module to install. - */ -function drupal_install_module($module) { - if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) { - module_load_install($module); - module_invoke($module, 'install'); - $versions = drupal_get_schema_versions($module); - drupal_set_installed_schema_version($module, $versions ? max($versions) : SCHEMA_INSTALLED); - module_enable($module); - } + module_enable($enable_modules); } /** |