function drupal_load_updates

Same name in other branches
  1. 7.x includes/install.inc \drupal_load_updates()
  2. 8.9.x core/includes/install.inc \drupal_load_updates()
  3. 10 core/includes/install.inc \drupal_load_updates()
  4. 11.x core/includes/install.inc \drupal_load_updates()

Loads .install files for installed modules to initialize the update system.

3 calls to drupal_load_updates()
DbUpdateController::handle in core/modules/system/src/Controller/DbUpdateController.php
Returns a database update page.
SystemManager::listRequirements in core/modules/system/src/SystemManager.php
Displays the site status report. Can also be used as a pure check.
UpdatePathTestTrait::runUpdates in core/tests/Drupal/Tests/UpdatePathTestTrait.php
Helper function to run pending database updates.

File

core/includes/install.inc, line 81

Code

function drupal_load_updates() {
    
    /** @var \Drupal\Core\Extension\ModuleExtensionList $extension_list_module */
    $extension_list_module = \Drupal::service('extension.list.module');
    foreach (\Drupal::service('update.update_hook_registry')->getAllInstalledVersions() as $module => $schema_version) {
        if ($extension_list_module->exists($module) && !$extension_list_module->checkIncompatibility($module)) {
            if ($schema_version > -1) {
                \Drupal::moduleHandler()->loadInclude($module, 'install');
            }
        }
    }
}

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