function UpdateRegistry::getPendingUpdateFunctions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getPendingUpdateFunctions()
  2. 8.9.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getPendingUpdateFunctions()
  3. 11.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getPendingUpdateFunctions()

Find all update functions that haven't been executed.

Return value

callable[] An alphabetical list of update functions that have not been executed.

1 call to UpdateRegistry::getPendingUpdateFunctions()
UpdateRegistry::getPendingUpdateInformation in core/lib/Drupal/Core/Update/UpdateRegistry.php
Returns a list of all the pending updates.

File

core/lib/Drupal/Core/Update/UpdateRegistry.php, line 168

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function getPendingUpdateFunctions() {
    // We need a) the list of active extensions (we get that from the config
    // bootstrap factory) and b) the path to the extensions, we use extension
    // discovery for that.
    $this->scanExtensionsAndLoadUpdateFiles();
    // First figure out which hook_{$this->updateType}_NAME got executed
    // already.
    $existing_update_functions = $this->keyValue
        ->get('existing_updates', []);
    $available_update_functions = $this->getAvailableUpdateFunctions();
    $not_executed_update_functions = array_diff($available_update_functions, $existing_update_functions);
    return $not_executed_update_functions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.