Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UpdateRegistry.php

function UpdateRegistry::scanExtensionsAndLoadUpdateFiles

Scans all module, theme, and profile extensions and load the update files.

Parameters

string|null $extension: (optional) Limits the extension update files loaded to the provided extension.

3 calls to UpdateRegistry::scanExtensionsAndLoadUpdateFiles()
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 an extension.
UpdateRegistry::getUpdateFunctions in core/lib/Drupal/Core/Update/UpdateRegistry.php
Returns all available updates for a given extension.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

protected function scanExtensionsAndLoadUpdateFiles(?string $extension = NULL) {
    if ($extension !== NULL && isset(self::$loadedFiles[$this->root][$this->sitePath][$extension][$this->updateType])) {
        // We've already checked for this file and, if it exists, loaded it.
        return;
    }
    // Scan for extensions.
    $extension_discovery = new ExtensionDiscovery($this->root, TRUE, [], $this->sitePath);
    $module_extensions = $extension_discovery->scan('module');
    $theme_extensions = $this->includeThemes() ? $extension_discovery->scan('theme') : [];
    $profile_extensions = $extension_discovery->scan('profile');
    $extensions = array_merge($module_extensions, $theme_extensions, $profile_extensions);
    // Limit to a single extension.
    if ($extension) {
        $extensions = array_intersect_key($extensions, [
            $extension => TRUE,
        ]);
    }
    $this->loadUpdateFiles($extensions);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal