function _batch_do

_batch_do()

Does one execution pass with JavaScript and returns progress to the browser.

See also

_batch_progress_page_js()

_batch_process()

File

includes/batch.inc, line 152
Batch processing API for processes to run in multiple HTTP requests.

Code

function _batch_do() {
  // HTTP POST required.
  if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    drupal_set_message(t('HTTP POST is required.'), 'error');
    drupal_set_title(t('Error'));
    return '';
  }

  // Perform actual processing.
  list($percentage, $message) = _batch_process();

  drupal_json_output(array('status' => TRUE, 'percentage' => $percentage, 'message' => $message));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!batch.inc/function/_batch_do/7.x