function update_finished

Finish the update process and store 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.

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

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

See also

update_batch()

1 string reference to 'update_finished'
update_batch in drupal/core/includes/update.inc
Start the database update batch process.

File

drupal/core/includes/update.inc, line 742
Drupal database update API.

Code

function update_finished($success, $results, $operations) {

  // Clear the caches in case the data has been updated.
  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 in maintenance mode.
  if (isset($_SESSION['maintenance_mode'])) {
    $GLOBALS['conf']['system.maintenance']['enabled'] = FALSE;

    // At this point, the configuration system should exist.
    config('system.maintenance')
      ->set('enabled', FALSE)
      ->save();
    unset($_SESSION['maintenance_mode']);
  }
}