You are here

protected function UpdateRegistry::scanExtensionsAndLoadUpdateFiles in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::scanExtensionsAndLoadUpdateFiles()
  2. 10 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::scanExtensionsAndLoadUpdateFiles()

Scans all module + profile extensions and load the update files.

3 calls to UpdateRegistry::scanExtensionsAndLoadUpdateFiles()
UpdateRegistry::getModuleUpdateFunctions in core/lib/Drupal/Core/Update/UpdateRegistry.php
Returns all available updates for a given module.
UpdateRegistry::getPendingUpdateFunctions in core/lib/Drupal/Core/Update/UpdateRegistry.php
Find all update functions that haven't been executed.
UpdateRegistry::getRemovedPostUpdates in core/lib/Drupal/Core/Update/UpdateRegistry.php
Gets removed hook_post_update_NAME() implementations for a module.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

protected function scanExtensionsAndLoadUpdateFiles() {

  // Scan the module list.
  $extension_discovery = new ExtensionDiscovery($this->root, FALSE, [], $this->sitePath);
  $module_extensions = $extension_discovery
    ->scan('module');
  $profile_extensions = $extension_discovery
    ->scan('profile');
  $extensions = array_merge($module_extensions, $profile_extensions);
  $this
    ->loadUpdateFiles($extensions);
}