function _drush_batch_shutdown

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

Shutdown function: store the batch data for next request, or clear the table if the batch is finished.

1 string reference to '_drush_batch_shutdown'
_drush_batch_command in commands/core/drupal/batch.inc
Initialize the batch command and call the worker function.

File

commands/core/drupal/batch.inc, line 277
Drupal 7 engine for the Batch API

Code

function _drush_batch_shutdown() {
  if ($batch = batch_get()) {
    if (drush_drupal_major_version() >= 8) {
      /** @var \Drupal\Core\Batch\BatchStorage $batch_storage */
      $batch_storage = \Drupal::service('batch.storage');
      $batch_storage->update($batch);
    }
    else {
      db_update('batch')->fields(array('batch' => serialize($batch)))->condition('bid', $batch['id'])->execute();
    }
  }
}