$post_updates =
$this->postUpdateRegistry->
getPendingUpdateFunctions();
if ($post_updates) { // Now we rebuild all caches and after that execute the hook_post_update()
// functions.
$batch_builder->
addOperation('drupal_flush_all_caches',
[]);
foreach ($post_updates as $function) { $batch_builder->
addOperation('update_invoke_post_update',
[$function]);
} } batch_set($batch_builder->
toArray());
// @todo Revisit once https://www.drupal.org/node/2548095 is in.
return batch_process(Url::
fromUri('base://results'
), Url::
fromUri('base://start'
));
} /**
* 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.
*
* @param $success
* Indicate that the batch API tasks were all completed successfully.
* @param array $results
* An array of all the results that were updated in update_do_one().
* @param array $operations
* A list of all the operations that had not been completed by the batch API.
*/