function _drush_batch_finished

8.0.x batch_6.inc _drush_batch_finished()
8.0.x batch.inc _drush_batch_finished()
6.x batch_6.inc _drush_batch_finished()
6.x batch.inc _drush_batch_finished()
7.x batch_6.inc _drush_batch_finished()
7.x batch.inc _drush_batch_finished()
3.x batch_6.inc _drush_batch_finished()
3.x batch_7.inc _drush_batch_finished()
4.x batch_6.inc _drush_batch_finished()
4.x batch.inc _drush_batch_finished()
5.x batch_6.inc _drush_batch_finished()
5.x batch.inc _drush_batch_finished()
master batch.inc _drush_batch_finished()

End the batch processing: Call the 'finished' callbacks to allow custom handling of results, and resolve page redirection.

2 calls to _drush_batch_finished()
_drush_batch_command in commands/core/drupal/batch_6.inc
Initialize the batch command and call the worker function.
_drush_batch_command in commands/core/drupal/batch_7.inc
Initialize the batch command and call the worker function.

File

commands/core/drupal/batch_7.inc, line 206
Drupal 7 engine for the Batch API

Code

function _drush_batch_finished() {
  $batch = &batch_get();

  // Execute the 'finished' callbacks for each batch set, if defined.
  foreach ($batch['sets'] as $batch_set) {
    if (isset($batch_set['finished'])) {
      // Check if the set requires an additional file for function definitions.
      if (isset($batch_set['file']) && is_file($batch_set['file'])) {
        include_once DRUPAL_ROOT . '/' . $batch_set['file'];
      }
      if (function_exists($batch_set['finished'])) {
        $queue = _batch_queue($batch_set);
        $operations = $queue->getAllItems();
        $batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
      }
    }
  }

  // Clean up the batch table and unset the static $batch variable.
  db_delete('batch')->condition('bid', $batch['id'])->execute();
  foreach ($batch['sets'] as $batch_set) {
    if ($queue = _batch_queue($batch_set)) {
      $queue->deleteQueue();
    }
  }
  $_batch = $batch;
  $batch = NULL;
  drush_set_option('drush_batch_process_finished', TRUE);
}