// Set the installed version of each module so updates will start at the
// correct place. (The updates are already sorted, so we can simply base
// this on the first one we come across in the above foreach loop.)
if (isset($start[$update['module'
]])) { \Drupal::
service('update.update_hook_registry'
)->
setInstalledVersion($update['module'
],
$update['number'
] - 1
);
unset($start[$update['module'
]]);
} $batch_builder->
addOperation('update_do_one',
[$update['module'
],
$update['number'
],
$dependency_map[$function]]);
} } $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());