function UpdateRegistry::loadUpdateFile

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::loadUpdateFile()
  2. 10 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::loadUpdateFile()
  3. 11.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::loadUpdateFile()

Loads the {$this->updateType}.php file for a given extension.

Parameters

\Drupal\Core\Extension\Extension $extension: The extension object to load its file.

1 call to UpdateRegistry::loadUpdateFile()
UpdateRegistry::loadUpdateFiles in core/lib/Drupal/Core/Update/UpdateRegistry.php
Loads all update files for a given list of extension.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

protected function loadUpdateFile(Extension $extension) {
    $filename = $this->root . '/' . $extension->getPath() . '/' . $extension->getName() . ".{$this->updateType}.php";
    if (file_exists($filename)) {
        include_once $filename;
    }
}

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