1 installer.browser.inc _installer_browser_batch_install_release($release_name, $project, &$context)

Batch API callback: Installs a single release of a project during batch.

Parameters

$release_name: The short name of the selected release of the project being installed.

$project: Associative array of information about the project to be installed.

File

core/modules/installer/installer.browser.inc, line 322
Various functions that are required by the Installer browse pages.

Code

function _installer_browser_batch_install_release($release_name, $project, &$context) {
  $release = installer_browser_get_release($release_name, $project);

  module_load_include('inc', 'installer', 'installer.manager');
  $url = file_create_url($release['download_link']);
  $result = installer_manager_download_project($url, TRUE);

  if ($result['success']) {
    $context['results']['successes'][] = t('Successfully installed %project.', array('%project' => $project['title']));
    $context['message'] = t('Installed %project...', array('%project' => $project['title']));

    // Add this to the session variable and remove it from the install_queue
    // variable.
    $_SESSION['installer_browser_installed_projects'][$project['name']] = $project;
    unset($_SESSION['installer_browser_install_list'][$project['name']]);
  }
  else {
    watchdog('installer', 'There was an error while installing %project.
      !message', 
    array('%project' => $project['title'], '!message' => $result['message']), WATCHDOG_ERROR);
    $context['results']['failures'][] = t('Error installing %project. !message', 
    array('%project' => $project['title'], '!message' => $result['message']));
    $context['message'] = t('Error installing %project. Errors have been logged.', 
    array('%project' => $project['title']));
  }
}