function drush_update_batch

8.0.x update.inc drush_update_batch()
8.0.x update_7.inc drush_update_batch($start)
6.x update.inc drush_update_batch($start)
6.x update_7.inc drush_update_batch($start)
7.x update.inc drush_update_batch($start)
7.x update_7.inc drush_update_batch($start)
3.x update_7.inc drush_update_batch($start)
4.x update.inc drush_update_batch($start)
5.x update.inc drush_update_batch($start)
5.x update_7.inc drush_update_batch($start)
master update.inc drush_update_batch()
master update_7.inc drush_update_batch($start)

Start the database update batch process.

Parameters

$start: An array of all the modules and which update to start at.

$redirect: Path to redirect to when the batch has finished processing.

$url: URL of the batch processing page (should only be used for separate scripts like update.php).

$batch: Optional parameters to pass into the batch API.

$redirect_callback: (optional) Specify a function to be called to redirect to the progressive processing page.

2 calls to drush_update_batch()
update_main in commands/core/drupal/update.inc
update_main in commands/core/drupal/update_7.inc

File

commands/core/drupal/update.inc, line 264
Update.php for provisioned sites. This file is a derivative of the standard drupal update.php, which has been modified to allow being run from the command line.

Code

function drush_update_batch($start) {
  // Resolve any update dependencies to determine the actual updates that will
  // be run and the order they will be run in.
  $updates = update_resolve_dependencies($start);

  // Store the dependencies for each update function in an array which the
  // batch API can pass in to the batch operation each time it is called. (We
  // do not store the entire update dependency array here because it is
  // potentially very large.)
  $dependency_map = array();
  foreach ($updates as $function => $update) {
    $dependency_map[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : array();
  }

  $operations = array();
  foreach ($updates as $update) {
    if ($update['allowed']) {
      // Set the installed version of each module so updates will start at the
      // correct place. (The updates are already sorted, so we can simply base
      // this on the first one we come across in the above foreach loop.)
      if (isset($start[$update['module']])) {
        drupal_set_installed_schema_version($update['module'], $update['number'] - );
        unset($start[$update['module']]);
      }
      // Add this update function to the batch.
      $function = $update['module'] . '_update_' . $update['number'];
      $operations[] = array('drush_update_do_one', array($update['module'], $update['number'], $dependency_map[$function]));
    }
  }

  $batch['operations'] = $operations;
  $batch += array(
    'title' => 'Updating',
    'init_message' => 'Starting updates',
    'error_message' => 'An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.',
    'finished' => 'drush_update_finished',
    'file' => 'includes/update.inc',
  );
  batch_set($batch);
  drush_backend_batch_process('updatedb-batch-process');
}