DbUpdateController::batchFinished

public static DbUpdateController::batchFinished($success, $results, $operations)

Finishes the update process and stores the results for eventual display.

After the updates run, all caches are flushed. The update results are stored into the session (for example, to be displayed on the update results page in update.php). Additionally, if the site was off-line, now that the update process is completed, the site is set back online.

Parameters

$success: Indicate that the batch API tasks were all completed successfully.

array $results: An array of all the results that were updated in update_do_one().

array $operations: A list of all the operations that had not been completed by the batch API.

File

core/modules/system/src/Controller/DbUpdateController.php, line 648

Class

DbUpdateController
Controller routines for database update routes.

Namespace

Drupal\system\Controller

Code

public static function batchFinished($success, $results, $operations) {
  // No updates to run, so caches won't get flushed later.  Clear them now.
  drupal_flush_all_caches();

  $_SESSION['update_results'] = $results;
  $_SESSION['update_success'] = $success;
  $_SESSION['updates_remaining'] = $operations;

  // Now that the update is done, we can put the site back online if it was
  // previously not in maintenance mode.
  if (empty($_SESSION['maintenance_mode'])) {
    \Drupal::state()->set('system.maintenance_mode', FALSE);
  }
  unset($_SESSION['maintenance_mode']);
}
doc_Drupal
2016-10-29 09:01:23
Comments
Leave a Comment

Please login to continue.