public function UpdateRegistry::getPendingUpdateFunctions

public UpdateRegistry::getPendingUpdateFunctions()

Find all update functions that haven't been executed.

Return value

callable[] A list of update functions.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function getPendingUpdateFunctions() {
  // We need a) the list of active modules (we get that from the config
  // bootstrap factory) and b) the path to the modules, we use the 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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Update!UpdateRegistry.php/function/UpdateRegistry::getPendingUpdateFunctions/8.1.x