_batch_api_percentage

_batch_api_percentage($total, $current) Formats the percent completion for a batch set. Parameters int $total: The total number of operations. int|float $current: The number of the current operation. This may be a floating point number rather than an integer in the case of a multi-step operation that is not yet complete; in that case, the fractional part of $current represents the fraction of the operation that has been completed. Return value string The properly formatted percentage, as a st

_batch_current_set

&_batch_current_set() Returns the batch set being currently processed. File core/includes/batch.inc, line 363 Batch processing API for processes to run in multiple HTTP requests. Code function &_batch_current_set() { $batch = &batch_get(); return $batch['sets'][$batch['current_set']]; }

_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 core/includes/batch.inc, line 93 Batch processing API for processes to run in multiple HTTP requests. Code function _batch_do() { // Perform actual processing. list($percentage, $message, $label) = _batch_process(); return new JsonResponse(array('status' => TRUE, 'percentage' => $percentage, 'message' => $message, 'label' => $lab

_batch_finished

_batch_finished() Ends the batch processing. Call the 'finished' callback of each batch set to allow custom handling of the results and resolve page redirection. File core/includes/batch.inc, line 400 Batch processing API for processes to run in multiple HTTP requests. Code function _batch_finished() { $batch = &batch_get(); $batch_finished_redirect = NULL; // Execute the 'finished' callbacks for each batch set, if defined. foreach ($batch['sets'] as $batch_set) { if (isset($

_batch_next_set

_batch_next_set() Retrieves the next set in a batch. If there is a subsequent set in this batch, assign it as the new set to process and execute its form submit handler (if defined), which may add further sets to this batch. Return value true|null TRUE if a subsequent set was found in the batch; no value will be returned if no subsequent set was found. File core/includes/batch.inc, line 379 Batch processing API for processes to run in multiple HTTP requests. Code function _batch_next_set() {

_batch_page

_batch_page(Request $request) Renders the batch processing page based on the current state of the batch. Parameters \Symfony\Component\HttpFoundation\Request $request: The current request object. See also _batch_shutdown() File core/includes/batch.inc, line 34 Batch processing API for processes to run in multiple HTTP requests. Code function _batch_page(Request $request) { $batch = &batch_get(); if (!($request_id = $request->query->get('id'))) { return FALSE; } // Re

_batch_populate_queue

_batch_populate_queue(&$batch, $set_id) Populates a job queue with the operations of a batch set. Depending on whether the batch is progressive or not, the Drupal\Core\Queue\Batch or Drupal\Core\Queue\BatchMemory handler classes will be used. The name and class of the queue are added by reference to the batch set. Parameters $batch: The batch array. $set_id: The id of the set to process. Related topics Batch operations Creates and processes batch operations. File core/includes/form.inc,

_batch_process

_batch_process() Processes sets in a batch. If the batch was marked for progressive execution (default), this executes as many operations in batch sets until an execution time of 1 second has been exceeded. It will continue with the next operation of the same batch set in the next request. Return value array An array containing a completion value (in percent) and a status message. File core/includes/batch.inc, line 209 Batch processing API for processes to run in multiple HTTP requests. Code

_batch_progress_page

_batch_progress_page() Outputs a batch processing page. See also _batch_process() File core/includes/batch.inc, line 105 Batch processing API for processes to run in multiple HTTP requests. Code function _batch_progress_page() { $batch = &batch_get(); $current_set = _batch_current_set(); $new_op = 'do_nojs'; if (!isset($batch['running'])) { // This is the first page so we return some output immediately. $percentage = 0; $message = $current_set['init_message'];

_batch_queue

_batch_queue($batch_set) Returns a queue object for a batch set. Parameters $batch_set: The batch set. Return value The queue object. Related topics Batch operations Creates and processes batch operations. File core/includes/form.inc, line 932 Functions for form and batch generation and processing. Code function _batch_queue($batch_set) { static $queues; if (!isset($queues)) { $queues = array(); } if (isset($batch_set['queue'])) { $name = $batch_set['queue']['name'];