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

Breadcrumb

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

function UpdateRegistry::getUpdateFunctions

Returns all available updates for a given extension.

Parameters

string $extension_name: The extension name.

Return value

callable[] A list of update functions.

1 call to UpdateRegistry::getUpdateFunctions()
UpdateRegistry::onConfigSave in core/lib/Drupal/Core/Update/UpdateRegistry.php
Processes the list of installed extensions when core.extension changes.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function getUpdateFunctions($extension_name) {
    $this->scanExtensionsAndLoadUpdateFiles($extension_name);
    $updates = [];
    $functions = get_defined_functions();
    foreach (preg_grep('/^' . $extension_name . '_' . $this->updateType . '_/', $functions['user']) as $function) {
        $updates[] = $function;
    }
    // Ensure that the update order is deterministic.
    sort($updates);
    return $updates;
}

API Navigation

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