function _drush_batch_command

8.0.x batch_6.inc _drush_batch_command($id)
8.0.x batch.inc _drush_batch_command($id)
6.x batch_6.inc _drush_batch_command($id)
6.x batch.inc _drush_batch_command($id)
7.x batch_6.inc _drush_batch_command($id)
7.x batch.inc _drush_batch_command($id)
3.x batch_6.inc _drush_batch_command($id)
3.x batch_7.inc _drush_batch_command($id)
4.x batch_6.inc _drush_batch_command($id)
4.x batch.inc _drush_batch_command($id)
5.x batch_6.inc _drush_batch_command($id)
5.x batch.inc _drush_batch_command($id)
master batch.inc _drush_batch_command($id)

Initialize the batch command and call the worker function.

Loads the batch record from the database and sets up the requirements for the worker, such as registering the shutdown function.

Parameters

id: The batch id of the batch being processed.

1 call to _drush_batch_command()
drush_batch_command in includes/batch.inc
Process sets from the specified batch.

File

commands/core/drupal/batch_6.inc, line 59
Drupal 6 engine for the Batch API

Code

function _drush_batch_command($id) {
  $batch = &batch_get();
  // Retrieve the current state of batch from db.
  if ($data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d", $id))) {
    $batch = unserialize($data);
  }
  else {
    return FALSE;
  }
  if (!isset($batch['running'])) {
    $batch['running'] = TRUE;
  }

  // Register database update for end of processing.
  register_shutdown_function('_drush_batch_shutdown');

  if (_drush_batch_worker()) {
    _drush_batch_finished();
  }
}