diff options
Diffstat (limited to 'includes/batch.inc')
-rw-r--r-- | includes/batch.inc | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/includes/batch.inc b/includes/batch.inc index 727c62560..19c769548 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -1,6 +1,5 @@ <?php - /** * @file * Batch processing API for processes to run in multiple HTTP requests. @@ -21,6 +20,7 @@ * @param $id * The ID of the batch to load. When a progressive batch is being processed, * the relevant ID is found in $_REQUEST['id']. + * * @return * An array representing the batch, or FALSE if no batch was found. */ @@ -36,7 +36,7 @@ function batch_load($id) { } /** - * State-based dispatcher for the batch processing page. + * Renders the batch processing page based on the current state of the batch. * * @see _batch_shutdown() */ @@ -94,7 +94,7 @@ function _batch_page() { } /** - * Initialize the batch processing. + * Initializes the batch processing. * * JavaScript-enabled clients are identified by the 'has_js' cookie set in * drupal.js. If no JavaScript-enabled page has been visited during the current @@ -110,7 +110,7 @@ function _batch_start() { } /** - * Output a batch processing page with JavaScript support. + * Outputs a batch processing page with JavaScript support. * * This initializes the batch and error messages. Note that in JavaScript-based * processing, the batch processing page is displayed only once and updated via @@ -144,7 +144,7 @@ function _batch_progress_page_js() { } /** - * Do one execution pass in JavaScript-mode and return progress to the browser. + * Does one execution pass with JavaScript and returns progress to the browser. * * @see _batch_progress_page_js() * @see _batch_process() @@ -164,7 +164,7 @@ function _batch_do() { } /** - * Output a batch processing page without JavaScript support. + * Outputs a batch processing page without JavaScript support. * * @see _batch_process() */ @@ -228,7 +228,7 @@ function _batch_progress_page_nojs() { } /** - * Process sets in a batch. + * 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 @@ -370,7 +370,7 @@ function _batch_process() { } /** - * Helper function for _batch_process(): returns the formatted percentage. + * Formats the percent completion for a batch set. * * @param $total * The total number of operations. @@ -379,11 +379,14 @@ function _batch_process() { * 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 * The properly formatted percentage, as a string. We output percentages * using the correct number of decimal places so that we never print "100%" * until we are finished, but we also never print more decimal places than * are meaningful. + * + * @see _batch_process() */ function _batch_api_percentage($total, $current) { if (!$total || $total == $current) { @@ -410,7 +413,7 @@ function _batch_api_percentage($total, $current) { } /** - * Return the batch set being currently processed. + * Returns the batch set being currently processed. */ function &_batch_current_set() { $batch = &batch_get(); @@ -418,7 +421,7 @@ function &_batch_current_set() { } /** - * Retrieve the next set in a batch. + * 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 @@ -442,7 +445,7 @@ function _batch_next_set() { } /** - * End the batch processing. + * Ends the batch processing. * * Call the 'finished' callback of each batch set to allow custom handling of * the results and resolve page redirection. @@ -521,7 +524,10 @@ function _batch_finished() { } /** - * Shutdown function; store the current batch data for the next request. + * Shutdown function: Stores the current batch data for the next request. + * + * @see _batch_page() + * @see drupal_register_shutdown_function() */ function _batch_shutdown() { if ($batch = batch_get()) { |