You are here

function patterns_install_modules in Patterns 6.2

Same name and namespace in other branches
  1. 6 patterns.module \patterns_install_modules()
  2. 7.2 includes/core/modules.inc \patterns_install_modules()
  3. 7 includes/core/modules.inc \patterns_install_modules()
3 calls to patterns_install_modules()
patterns_execute_pattern_batch in ./patterns.module
patterns_execute_pattern_drush in ./patterns.drush.inc
patterns_execute_pattern_drushbatch in ./patterns.drush.inc
This is a fork of patterns_execute_patterns_batch(), and will be adapted to use the drush batch api instead @todo (evergreen todo): make sure this is always in sync with patterns_execute_pattern_batch().

File

./patterns.module, line 1444
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_install_modules(&$modules) {
  $result = array(
    'success' => TRUE,
  );
  if (empty($modules)) {
    return $result;
  }
  $missing = patterns_check_module_dependencies($modules, TRUE);
  if (!empty($missing)) {
    $result['success'] = FALSE;
    $result['error_message'] = t('Following required modules are missing: %modules', array(
      '%modules' => implode(', ', $missing),
    ));
    $result['missing_modules'] = $missing;
    return $result;
  }
  require_once './includes/install.inc';
  drupal_install_modules($modules);
  module_rebuild_cache();
  $result['installed_modules'] = $modules;
  return $result;
}