You are here

function quickupdate_manager_batch_project_get in Quick update 7

Same name and namespace in other branches
  1. 8 quickupdate.module \quickupdate_manager_batch_project_get()

Batch callback: Downloads, unpacks, and verifies a project.

This function assumes that the provided URL points to a file archive of some sort. The URL can have any scheme that we have a file stream wrapper to support. The file is downloaded to a local cache.

Parameters

string $project: The short name of the project to download.

string $url: The URL to download a specific project release archive file.

array $context: Reference to an array used for Batch API storage.

1 string reference to 'quickupdate_manager_batch_project_get'
quickupdate_manager_update_form_submit in ./quickupdate.module
Form submission handler for quickupdate_manager_update_form().

File

./quickupdate.module, line 226
Primarily Drupal hooks and global API functions.

Code

function quickupdate_manager_batch_project_get($project, $url, &$context) {
  if (empty($url)) {

    // For installing missing dependency projects or new projects,
    // we need to get their download urls because we don't have their
    // information in Drupal system.
    $available = quickupdate_get_project($project);
    $url = $available['download_link'];

    // If we still didn't get the download url, just ignore this project.
    // Probably the project doesn't exist.
    if (empty($url)) {
      return;
    }
  }
  module_load_include('inc', 'update', 'update.manager');
  return update_manager_batch_project_get($project, $url, $context);
}