public static function DbUpdateController::batchFinished in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/Controller/DbUpdateController.php \Drupal\system\Controller\DbUpdateController::batchFinished()
- 9 core/modules/system/src/Controller/DbUpdateController.php \Drupal\system\Controller\DbUpdateController::batchFinished()
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 660
Class
- DbUpdateController
- Controller routines for database update routes.
Namespace
Drupal\system\ControllerCode
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 = \Drupal::request()
->getSession();
$session
->set('update_results', $results);
$session
->set('update_success', $success);
$session
->set('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 (!$session
->remove('maintenance_mode')) {
\Drupal::state()
->set('system.maintenance_mode', FALSE);
}
}