You are here

function apps_download_apps_batch in Apps 7

Make the batch for downloading modules for app.

Split out for use in apps.profile.inc

2 calls to apps_download_apps_batch()
apps_download_apps in ./apps.installer.inc
Download all modules and library to a temp location.
apps_profile_download_app_modules in ./apps.profile.inc
Batch process apps download.

File

./apps.installer.inc, line 28
installer.inc hold all of the function used to download apps and thier deps

Code

function apps_download_apps_batch($apps) {
  $download_commands = array();
  foreach ($apps as $app) {
    $downloads = apps_download_apps_list($app);
    foreach ($downloads as $download) {
      $download_commands[] = array(
        'apps_download_batch',
        array(
          $download['name'],
          $download['url'],
          $download['type'],
          $download['version'],
          $app,
        ),
      );
    }
  }
  $batch = array(
    'operations' => $download_commands,
    'file' => drupal_get_path('module', 'apps') . '/apps.installer.inc',
    'title' => t('Downloading modules'),
    'init_message' => t('Preparing to download needed modules'),
    'finished' => 'apps_download_batch_finished',
  );
  return $batch;
}