update_finished

6 update.php update_finished($success, $results, $operations)
7 update.inc update_finished($success, $results, $operations)
8 update.inc update_finished($success, $results, $operations)

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'

File

includes/update.inc, line 1096
Drupal database update API.

Code

function update_finished($success, $results, $operations) {
  // Remove the D6 upgrade flag variable so that subsequent update runs do not
  // get the wrong context.
  variable_del('update_d6');

  // 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']) && $_SESSION['maintenance_mode'] == FALSE) {
    variable_set('maintenance_mode', FALSE);
    unset($_SESSION['maintenance_mode']);
  }
}
Login or register to post comments