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_6.inc, line 163
Drupal 6 engine for the Batch API

Code

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

  // Execute the 'finished' callbacks for each batch set.
  foreach ($batch['sets'] as $key => $batch_set) {
    if (isset($batch_set['finished'])) {
      // Check if the set requires an additional file for functions definitions.
      if (isset($batch_set['file']) && is_file($batch_set['file'])) {
        include_once ($batch_set['file']);
      }
      if (function_exists($batch_set['finished'])) {
        $batch_set['finished']($batch_set['success'], $batch_set['results'], $batch_set['operations']);
      }
    }
  }

  // Cleanup the batch table and unset the global $batch variable.
  db_query("DELETE FROM {batch} WHERE bid = %d", $batch['id']);
  $_batch = $batch;
  $batch = NULL;
  drush_set_option('drush_batch_process_finished', TRUE);
}